diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 9dc5e9a7b1d0398f1d872804984cb999f3235dee..8e05c1bd399d10343cf85a53c3049012ab6bdf38 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -2072,6 +2072,12 @@ static SQLFunctionCtx* createSQLFunctionCtx(SQueryRuntimeEnv* pRuntimeEnv, SExpr } else if (functionId == TSDB_FUNC_SCALAR_EXPR) { pCtx->param[1].pz = (char*) &pRuntimeEnv->sasArray[i]; } + + // if group by , TSDB_FUNC_PRJ operator must set one row + if (pQueryAttr->groupbyColumn && functionId == TSDB_FUNC_PRJ) { + pCtx->param[0].i64 = 1; + pCtx->param[0].nType = TSDB_DATA_TYPE_BIGINT; + } } for(int32_t i = 1; i < numOfOutput; ++i) {