From 1191902d380d99cef345a7fa9b513c8430ed878b Mon Sep 17 00:00:00 2001 From: facetosea <25808407@qq.com> Date: Mon, 15 Jan 2024 13:06:22 +0800 Subject: [PATCH] fix error code and delete unused code --- source/libs/executor/src/aggregateoperator.c | 4 +-- source/libs/executor/src/executil.c | 2 +- source/libs/nodes/src/nodesUtilFuncs.c | 27 -------------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/source/libs/executor/src/aggregateoperator.c b/source/libs/executor/src/aggregateoperator.c index 63156de881..a3adb02ab9 100644 --- a/source/libs/executor/src/aggregateoperator.c +++ b/source/libs/executor/src/aggregateoperator.c @@ -282,7 +282,7 @@ int32_t doAggregateImpl(SOperatorInfo* pOperator, SqlFunctionCtx* pCtx) { } if ((&pCtx[k])->input.pData[0] == NULL) { - code = TSDB_CODE_PAR_NOT_SINGLE_GROUP; + code = TSDB_CODE_PAR_INTERNAL_ERROR; qError("%s aggregate function error happens, input data is NULL.", GET_TASKID(pOperator->pTaskInfo)); } else { code = pCtx[k].fpSet.process(&pCtx[k]); @@ -570,7 +570,7 @@ void applyAggFunctionOnPartialTuples(SExecTaskInfo* taskInfo, SqlFunctionCtx* pC int32_t code = TSDB_CODE_SUCCESS; if (functionNeedToExecute(&pCtx[k]) && pCtx[k].fpSet.process != NULL) { if ((&pCtx[k])->input.pData[0] == NULL) { - code = TSDB_CODE_PAR_NOT_SINGLE_GROUP; + code = TSDB_CODE_PAR_INTERNAL_ERROR; qError("%s apply functions error, input data is NULL.", GET_TASKID(taskInfo)); } else { code = pCtx[k].fpSet.process(&pCtx[k]); diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 9ac53a512c..825d716926 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -1477,7 +1477,7 @@ void createExprFromOneNode(SExprInfo* pExp, SNode* pNode, int16_t slotId) { SValueNode* pvn = (SValueNode*)p1; pExp->base.pParam[j].type = FUNC_PARAM_TYPE_VALUE; nodesValueNodeToVariant(pvn, &pExp->base.pParam[j].param); - } + } } } else if (type == QUERY_NODE_OPERATOR) { pExp->pExpr->nodeType = QUERY_NODE_OPERATOR; diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 446b29d7f2..dc16345916 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -2122,33 +2122,6 @@ static EDealRes collectFuncs(SNode* pNode, void* pContext) { return DEAL_RES_CONTINUE; } -static EDealRes collectSelectFuncs(SNode* pNode, void* pContext) { - SCollectFuncsCxt* pCxt = (SCollectFuncsCxt*)pContext; - if (QUERY_NODE_FUNCTION == nodeType(pNode) && pCxt->classifier(((SFunctionNode*)pNode)->funcId)) { - SFunctionNode* pFunc = (SFunctionNode*)pNode; - if (FUNCTION_TYPE_TBNAME == pFunc->funcType && pCxt->tableAlias) { - SValueNode* pVal = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 0); - if (pVal && strcmp(pVal->literal, pCxt->tableAlias)) { - return DEAL_RES_CONTINUE; - } - } - SExprNode* pExpr = (SExprNode*)pNode; - bool bFound = false; - SNode* pn = NULL; - FOREACH(pn, pCxt->pFuncs) { - if (nodesEqualNode(pn, pNode)) { - bFound = true; - break; - } - } - if (!bFound) { - pCxt->errCode = nodesListStrictAppend(pCxt->pFuncs, nodesCloneNode(pNode)); - } - return (TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR); - } - return DEAL_RES_CONTINUE; -} - static uint32_t funcNodeHash(const char* pKey, uint32_t len) { SExprNode* pExpr = *(SExprNode**)pKey; return MurmurHash3_32(pExpr->aliasName, strlen(pExpr->aliasName));