diff --git a/source/libs/scalar/src/sclvector.c b/source/libs/scalar/src/sclvector.c index 040f331ba46732dee026c98d19ca65c85891ac62..c376e7efb7e8a74ce71f1000792fe87b69145d36 100644 --- a/source/libs/scalar/src/sclvector.c +++ b/source/libs/scalar/src/sclvector.c @@ -1545,7 +1545,7 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa int32_t num = 0; bool * pRes = (bool *)pOut->columnData; - if (GET_PARAM_TYPE(pLeft) != TSDB_DATA_TYPE_JSON && GET_PARAM_TYPE(pRight) != TSDB_DATA_TYPE_JSON) { + if (GET_PARAM_TYPE(pLeft) == TSDB_DATA_TYPE_JSON || GET_PARAM_TYPE(pRight) == TSDB_DATA_TYPE_JSON) { for (int32_t i = startIndex; i < numOfRows && i >= startIndex; i += step) { int32_t leftIndex = (i >= pLeft->numOfRows) ? 0 : i; int32_t rightIndex = (i >= pRight->numOfRows) ? 0 : i;