diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index cad7bff7cb3b043eb1d1cda47597d46db12873a6..3c6596556a0aebc9b91a070d24810eadbb98c6fe 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -8140,8 +8140,8 @@ static tsdbReaderT createDataReaderImpl(STableScanPhysiNode* pTableScanNode, STa STargetNode* pNode = (STargetNode*)nodesListGetNode(pTableScanNode->scan.pScanCols, i); SColumnNode* pColNode = (SColumnNode*)pNode->pExpr; - cond.colList[i].type = pColNode->colType; - cond.colList[i].bytes = pColNode->node.resType.type; + cond.colList[i].type = pColNode->node.resType.type; + cond.colList[i].bytes = pColNode->node.resType.bytes; cond.colList[i].colId = pColNode->colId; } diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index c6330c6015b346c03e9477efa138f769f3c7ee8d..862354c1382872f63daec601924c623bd86a2877 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -27,6 +27,7 @@ typedef struct SFuncMgtService { static SFuncMgtService gFunMgtService; +// todo refactor int32_t fmFuncMgtInit() { gFunMgtService.pFuncNameHashTable = taosHashInit(funcMgtBuiltinsNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); if (NULL == gFunMgtService.pFuncNameHashTable) { diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 33bfaf73b72d4faf1c6208df3c864c21c921c297..a5f25fab28db2dfdc39dfbbe47c8a40f8d47ecbe 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -1232,11 +1232,16 @@ static int32_t jsonToSlotDescNode(const SJson* pJson, void* pObj) { static const char* jkDataBlockDescDataBlockId = "DataBlockId"; static const char* jkDataBlockDescSlots = "Slots"; +static const char* jkDataBlockResultRowSize = "ResultRowSize"; static int32_t dataBlockDescNodeToJson(const void* pObj, SJson* pJson) { const SDataBlockDescNode* pNode = (const SDataBlockDescNode*)pObj; int32_t code = tjsonAddIntegerToObject(pJson, jkDataBlockDescDataBlockId, pNode->dataBlockId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkDataBlockResultRowSize, pNode->resultRowSize); + } + if (TSDB_CODE_SUCCESS == code) { code = nodeListToJson(pJson, jkDataBlockDescSlots, pNode->pSlots); } @@ -1248,6 +1253,10 @@ static int32_t jsonToDataBlockDescNode(const SJson* pJson, void* pObj) { SDataBlockDescNode* pNode = (SDataBlockDescNode*)pObj; int32_t code = tjsonGetSmallIntValue(pJson, jkDataBlockDescDataBlockId, &pNode->dataBlockId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkDataBlockResultRowSize, &pNode->resultRowSize); + } + if (TSDB_CODE_SUCCESS == code) { code = jsonToNodeList(pJson, jkDataBlockDescSlots, &pNode->pSlots); } diff --git a/source/libs/parser/src/astTranslate.c b/source/libs/parser/src/astTranslate.c index 8f0656011768d6c91357247067f8214c6600ce66..ba879f2689d2852a5d6a2b2946c90d11de129926 100644 --- a/source/libs/parser/src/astTranslate.c +++ b/source/libs/parser/src/astTranslate.c @@ -162,7 +162,7 @@ static void setColumnInfoByExpr(const STableNode* pTable, SExprNode* pExpr, SCol static int32_t createColumnNodeByTable(STranslateContext* pCxt, const STableNode* pTable, SNodeList* pList) { if (QUERY_NODE_REAL_TABLE == nodeType(pTable)) { const STableMeta* pMeta = ((SRealTableNode*)pTable)->pMeta; - int32_t nums = pMeta->tableInfo.numOfTags + pMeta->tableInfo.numOfColumns; + int32_t nums = pMeta->tableInfo.numOfColumns + ((TSDB_SUPER_TABLE == pMeta->tableType)? pMeta->tableInfo.numOfTags:0); for (int32_t i = 0; i < nums; ++i) { SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { @@ -1009,6 +1009,7 @@ static int32_t setReslutSchema(STranslateContext* pCxt, SQuery* pQuery) { pQuery->pResSchema[index].type = pExpr->resType.type; pQuery->pResSchema[index].bytes = pExpr->resType.bytes; strcpy(pQuery->pResSchema[index].name, pExpr->aliasName); + index +=1; } } return TSDB_CODE_SUCCESS; diff --git a/source/libs/planner/src/physicalPlan.c b/source/libs/planner/src/physicalPlan.c index fa8c51c7313c632bf2eb8182debdae0ba4b17b28..6a522d4e9314955eeab0fb39fc054bc9017ccb5b 100644 --- a/source/libs/planner/src/physicalPlan.c +++ b/source/libs/planner/src/physicalPlan.c @@ -96,7 +96,8 @@ static int32_t addDataBlockDesc(SPhysiPlanContext* pCxt, SNodeList* pList, SData SNode* pTarget = createTarget(pNode, pDataBlockDesc->dataBlockId, slotId); CHECK_ALLOC(pTarget, TSDB_CODE_OUT_OF_MEMORY); REPLACE_NODE(pTarget); - + + pDataBlockDesc->resultRowSize += ((SSlotDescNode*)pSlot)->dataType.bytes; ++slotId; } return TSDB_CODE_SUCCESS;