diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 25d668e788357b596588f1282d0b8747242ac02f..9f4202f7566ff44e10b2ac5ef3c3fc23e846fb43 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -416,7 +416,11 @@ typedef struct { * But for data in vnode side, we need all the following information. */ typedef struct { - int16_t colId; + union { + int16_t colId; + int16_t slotId; + }; + int16_t type; int16_t bytes; SColumnFilterList flist; diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index d64c2596cdeab75f90b197a2ab8e55381f97bd2c..cad7bff7cb3b043eb1d1cda47597d46db12873a6 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -315,8 +315,6 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO } SSDataBlock* createOutputBuf_rv(SArray* pExprInfo, int32_t numOfRows) { - const static int32_t minSize = 8; - size_t numOfOutput = taosArrayGetSize(pExprInfo); SSDataBlock *res = calloc(1, sizeof(SSDataBlock)); @@ -330,15 +328,28 @@ SSDataBlock* createOutputBuf_rv(SArray* pExprInfo, int32_t numOfRows) { idata.info.type = pExpr->base.resSchema.type; idata.info.bytes = pExpr->base.resSchema.bytes; idata.info.colId = pExpr->base.resSchema.colId; - - int32_t size = TMAX(idata.info.bytes * numOfRows, minSize); - idata.pData = calloc(1, size); // at least to hold a pointer on x64 platform taosArrayPush(res->pDataBlock, &idata); } + blockDataEnsureCapacity(res, numOfRows); return res; } +SSDataBlock* createOutputBuf_rv1(SDataBlockDescNode* pNode) { + int32_t numOfCols = LIST_LENGTH(pNode->pSlots); + SSDataBlock* pBlock = calloc(1, sizeof(SSDataBlock)); + pBlock->info.numOfCols = numOfCols; + pBlock->pDataBlock = taosArrayInit(numOfCols, sizeof(SColumnInfoData)); + + for(int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData idata = {{0}}; + SSlotDescNode* pDescNode = nodesListGetNode(pNode->pSlots, i); + idata.info.type = pDescNode->dataType.type; + idata.info.bytes = pDescNode->dataType.bytes; + idata.info.slotId = pDescNode->slotId; + } +} + static bool isSelectivityWithTagsQuery(SqlFunctionCtx *pCtx, int32_t numOfOutput) { return true; // bool hasTags = false; @@ -8041,6 +8052,10 @@ static tsdbReaderT doCreateDataReader(STableScanPhysiNode* pTableScanNode, SRead static int32_t doCreateTableGroup(void* metaHandle, int32_t tableType, uint64_t tableUid, STableGroupInfo* pGroupInfo, uint64_t queryId, uint64_t taskId); SOperatorInfo* doCreateOperatorTreeNode(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SReadHandle* pHandle, uint64_t queryId, uint64_t taskId, STableGroupInfo* pTableGroupInfo) { + if (nodeType(pPhyNode) == QUERY_NODE_PHYSICAL_PLAN_PROJECT) { // ignore the project node + pPhyNode = nodesListGetNode(pPhyNode->pChildren, 0); + } + if (pPhyNode->pChildren == NULL || LIST_LENGTH(pPhyNode->pChildren) == 0) { if (QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN == nodeType(pPhyNode)) { SScanPhysiNode* pScanPhyNode = (SScanPhysiNode*)pPhyNode; @@ -8119,15 +8134,15 @@ static tsdbReaderT createDataReaderImpl(STableScanPhysiNode* pTableScanNode, STa cond.twindow = pTableScanNode->scanRange; cond.type = BLOCK_LOAD_OFFSET_SEQ_ORDER; +// cond.type = pTableScanNode->scanFlag; for (int32_t i = 0; i < cond.numOfCols; ++i) { - // SExprInfo* pExprInfo = taosArrayGetP(pTableScanNode->scan.node.pTargets, i); - // assert(pExprInfo->pExpr->nodeType == TEXPR_COL_NODE); + STargetNode* pNode = (STargetNode*)nodesListGetNode(pTableScanNode->scan.pScanCols, i); - // SSchema* pSchema = pExprInfo->pExpr->pSchema; - // cond.colList[i].type = pSchema->type; - // cond.colList[i].bytes = pSchema->bytes; - // cond.colList[i].colId = pSchema->colId; + SColumnNode* pColNode = (SColumnNode*)pNode->pExpr; + cond.colList[i].type = pColNode->colType; + cond.colList[i].bytes = pColNode->node.resType.type; + cond.colList[i].colId = pColNode->colId; } return tsdbQueryTables(readHandle, &cond, pGroupInfo, queryId, taskId); diff --git a/source/libs/executor/test/executorTests.cpp b/source/libs/executor/test/executorTests.cpp index 175d04beff1b11f50ad90c5562e8c100404d593c..bfa6325211dab47085601dbc10d4895d19cbe381 100644 --- a/source/libs/executor/test/executorTests.cpp +++ b/source/libs/executor/test/executorTests.cpp @@ -224,587 +224,717 @@ int main(int argc, char** argv) { TEST(testCase, build_executor_tree_Test) { const char* msg = "{\n" - " \"Type\": \"33\",\n" - " \"Name\": \"PhysiProject\",\n" - " \"PhysiProject\": {\n" - " \"OutputDataBlockDesc\": {\n" - " \"Type\": \"19\",\n" - " \"Name\": \"TupleDesc\",\n" - " \"TupleDesc\": {\n" - " \"DataBlockId\": \"1\",\n" - " \"Slots\": [\n" - " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" - " \"SlotId\": \"0\",\n" - " \"DataType\": {\n" - " \"Type\": \"9\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" + " \"NodeType\": \"48\",\n" + " \"Name\": \"PhysiSubplan\",\n" + " \"PhysiSubplan\": {\n" + " \"Id\": {\n" + " \"QueryId\": \"0\",\n" + " \"TemplateId\": \"0\",\n" + " \"SubplanId\": \"0\"\n" + " },\n" + " \"SubplanType\": \"0\",\n" + " \"MsgType\": \"515\",\n" + " \"Level\": \"0\",\n" + " \"NodeAddr\": {\n" + " \"Id\": \"1\",\n" + " \"InUse\": \"0\",\n" + " \"NumOfEps\": \"1\",\n" + " \"Eps\": [\n" + " {\n" + " \"Fqdn\": \"node1\",\n" + " \"Port\": \"6030\"\n" + " }\n" + " ]\n" + " },\n" + " \"RootNode\": {\n" + " \"NodeType\": \"41\",\n" + " \"Name\": \"PhysiProject\",\n" + " \"PhysiProject\": {\n" + " \"OutputDataBlockDesc\": {\n" + " \"NodeType\": \"19\",\n" + " \"Name\": \"TupleDesc\",\n" + " \"TupleDesc\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"Slots\": [\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"0\",\n" + " \"DataType\": {\n" + " \"Type\": \"9\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"Reserve\": false,\n" - " \"Output\": false\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" - " \"SlotId\": \"1\",\n" - " \"DataType\": {\n" - " \"Type\": \"4\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"4\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"1\",\n" + " \"DataType\": {\n" + " \"Type\": \"4\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"4\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"Reserve\": false,\n" - " \"Output\": false\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" - " \"SlotId\": \"2\",\n" - " \"DataType\": {\n" - " \"Type\": \"8\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"20\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"2\",\n" + " \"DataType\": {\n" + " \"Type\": \"8\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"20\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"Reserve\": false,\n" - " \"Output\": false\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" - " \"SlotId\": \"3\",\n" - " \"DataType\": {\n" - " \"Type\": \"5\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"3\",\n" + " \"DataType\": {\n" + " \"Type\": \"5\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"Reserve\": false,\n" - " \"Output\": false\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" - " \"SlotId\": \"4\",\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"4\",\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"Reserve\": false,\n" - " \"Output\": false\n" - " }\n" - " },\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"5\",\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" + " }\n" + " ]\n" + " }\n" + " },\n" + " \"Children\": [\n" " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" - " \"SlotId\": \"5\",\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" + " \"NodeType\": \"38\",\n" + " \"Name\": \"PhysiTableScan\",\n" + " \"PhysiTableScan\": {\n" + " \"OutputDataBlockDesc\": {\n" + " \"NodeType\": \"19\",\n" + " \"Name\": \"TupleDesc\",\n" + " \"TupleDesc\": {\n" + " \"DataBlockId\": \"0\",\n" + " \"Slots\": [\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"0\",\n" + " \"DataType\": {\n" + " \"Type\": \"9\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": true\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"1\",\n" + " \"DataType\": {\n" + " \"Type\": \"4\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"4\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": true\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"2\",\n" + " \"DataType\": {\n" + " \"Type\": \"8\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"20\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": true\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"3\",\n" + " \"DataType\": {\n" + " \"Type\": \"5\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": true\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"4\",\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": true\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"5\",\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": true\n" + " }\n" + " }\n" + " ]\n" + " }\n" " },\n" - " \"Reserve\": false,\n" - " \"Output\": false\n" - " }\n" - " }\n" - " ]\n" - " }\n" - " },\n" - " \"Children\": [\n" - " {\n" - " \"Type\": \"30\",\n" - " \"Name\": \"PhysiTableScan\",\n" - " \"PhysiTableScan\": {\n" - " \"OutputDataBlockDesc\": {\n" - " \"Type\": \"19\",\n" - " \"Name\": \"TupleDesc\",\n" - " \"TupleDesc\": {\n" - " \"DataBlockId\": \"0\",\n" - " \"Slots\": [\n" + " \"ScanCols\": [\n" " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"0\",\n" " \"SlotId\": \"0\",\n" - " \"DataType\": {\n" - " \"Type\": \"9\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"Reserve\": false,\n" - " \"Output\": true\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"9\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"ts\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"1\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"ts\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"0\"\n" + " }\n" + " }\n" " }\n" " },\n" " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"0\",\n" " \"SlotId\": \"1\",\n" - " \"DataType\": {\n" - " \"Type\": \"4\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"4\"\n" - " },\n" - " \"Reserve\": false,\n" - " \"Output\": true\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"4\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"4\"\n" + " },\n" + " \"AliasName\": \"c1\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"2\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c1\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"0\"\n" + " }\n" + " }\n" " }\n" " },\n" " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"0\",\n" " \"SlotId\": \"2\",\n" - " \"DataType\": {\n" - " \"Type\": \"8\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"20\"\n" - " },\n" - " \"Reserve\": false,\n" - " \"Output\": true\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"8\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"20\"\n" + " },\n" + " \"AliasName\": \"c2\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"3\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c2\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"0\"\n" + " }\n" + " }\n" " }\n" " },\n" " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"0\",\n" " \"SlotId\": \"3\",\n" - " \"DataType\": {\n" - " \"Type\": \"5\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"Reserve\": false,\n" - " \"Output\": true\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"5\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"c3\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"4\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c3\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"0\"\n" + " }\n" + " }\n" " }\n" " },\n" " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"0\",\n" " \"SlotId\": \"4\",\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"Reserve\": false,\n" - " \"Output\": true\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"c4\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"5\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c4\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"0\"\n" + " }\n" + " }\n" " }\n" " },\n" " {\n" - " \"Type\": \"20\",\n" - " \"Name\": \"SlotDesc\",\n" - " \"SlotDesc\": {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"0\",\n" " \"SlotId\": \"5\",\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"Reserve\": false,\n" - " \"Output\": true\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"c5\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"6\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c5\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"0\"\n" + " }\n" + " }\n" " }\n" " }\n" - " ]\n" + " ],\n" + " \"TableId\": \"1\",\n" + " \"TableType\": \"3\",\n" + " \"ScanOrder\": \"1\",\n" + " \"ScanCount\": \"1\",\n" + " \"ReverseScanCount\": \"0\",\n" + " \"ScanFlag\": \"0\",\n" + " \"StartKey\": \"-9223372036854775808\",\n" + " \"EndKey\": \"9223372036854775807\"\n" " }\n" - " },\n" - " \"ScanCols\": [\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"9\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"AliasName\": \"ts\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"1\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"ts\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\"\n" - " }\n" + " }\n" + " ],\n" + " \"Projections\": [\n" + " {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"SlotId\": \"0\",\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"9\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"ts\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"1\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"ts\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"0\"\n" " }\n" " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"1\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"4\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"4\"\n" - " },\n" - " \"AliasName\": \"c1\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"2\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c1\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\"\n" - " }\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"SlotId\": \"1\",\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"4\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"4\"\n" + " },\n" + " \"AliasName\": \"c1\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"2\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c1\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"1\"\n" " }\n" " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"2\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"8\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"20\"\n" - " },\n" - " \"AliasName\": \"c2\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"3\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c2\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\"\n" - " }\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"SlotId\": \"2\",\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"8\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"20\"\n" + " },\n" + " \"AliasName\": \"c2\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"3\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c2\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"2\"\n" " }\n" " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"3\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"5\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"AliasName\": \"c3\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"4\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c3\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\"\n" - " }\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"SlotId\": \"3\",\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"5\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"c3\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"4\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c3\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"3\"\n" " }\n" " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"4\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"AliasName\": \"c4\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"5\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c4\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\"\n" - " }\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"SlotId\": \"4\",\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"c4\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"5\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c4\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"4\"\n" " }\n" " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"5\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"AliasName\": \"c5\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"6\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c5\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\"\n" - " }\n" + " }\n" + " },\n" + " {\n" + " \"NodeType\": \"18\",\n" + " \"Name\": \"Target\",\n" + " \"Target\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"SlotId\": \"5\",\n" + " \"Expr\": {\n" + " \"NodeType\": \"1\",\n" + " \"Name\": \"Column\",\n" + " \"Column\": {\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"AliasName\": \"c5\",\n" + " \"TableId\": \"0\",\n" + " \"ColId\": \"6\",\n" + " \"ColType\": \"1\",\n" + " \"DbName\": \"test\",\n" + " \"TableName\": \"t1\",\n" + " \"TableAlias\": \"t1\",\n" + " \"ColName\": \"c5\",\n" + " \"DataBlockId\": \"0\",\n" + " \"SlotId\": \"5\"\n" " }\n" " }\n" " }\n" - " ],\n" - " \"TableId\": \"1\",\n" - " \"TableType\": \"3\",\n" - " \"ScanOrder\": \"1\",\n" - " \"ScanCount\": \"1\",\n" - " \"ReverseScanCount\": \"0\",\n" - " \"ScanFlag\": \"0\",\n" - " \"StartKey\": \"-9223372036854775808\",\n" - " \"EndKey\": \"9223372036854775807\"\n" - " }\n" - " }\n" - " ],\n" - " \"Projections\": [\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"1\",\n" - " \"SlotId\": \"0\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"9\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" - " },\n" - " \"AliasName\": \"ts\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"1\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"ts\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"0\"\n" - " }\n" " }\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"1\",\n" - " \"SlotId\": \"1\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"4\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"4\"\n" + " ]\n" + " }\n" + " },\n" + " \"DataSink\": {\n" + " \"NodeType\": \"46\",\n" + " \"Name\": \"PhysiDispatch\",\n" + " \"PhysiDispatch\": {\n" + " \"InputDataBlockDesc\": {\n" + " \"NodeType\": \"19\",\n" + " \"Name\": \"TupleDesc\",\n" + " \"TupleDesc\": {\n" + " \"DataBlockId\": \"1\",\n" + " \"Slots\": [\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"0\",\n" + " \"DataType\": {\n" + " \"Type\": \"9\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"AliasName\": \"c1\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"2\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c1\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"1\"\n" - " }\n" - " }\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"1\",\n" - " \"SlotId\": \"2\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"8\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"20\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"1\",\n" + " \"DataType\": {\n" + " \"Type\": \"4\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"4\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"AliasName\": \"c2\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"3\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c2\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"2\"\n" - " }\n" - " }\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"1\",\n" - " \"SlotId\": \"3\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"5\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"2\",\n" + " \"DataType\": {\n" + " \"Type\": \"8\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"20\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"AliasName\": \"c3\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"4\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c3\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"3\"\n" - " }\n" - " }\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"1\",\n" - " \"SlotId\": \"4\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"3\",\n" + " \"DataType\": {\n" + " \"Type\": \"5\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"AliasName\": \"c4\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"5\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c4\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"4\"\n" - " }\n" - " }\n" - " }\n" - " },\n" - " {\n" - " \"Type\": \"18\",\n" - " \"Name\": \"Target\",\n" - " \"Target\": {\n" - " \"DataBlockId\": \"1\",\n" - " \"SlotId\": \"5\",\n" - " \"Expr\": {\n" - " \"Type\": \"1\",\n" - " \"Name\": \"Column\",\n" - " \"Column\": {\n" - " \"DataType\": {\n" - " \"Type\": \"7\",\n" - " \"Precision\": \"0\",\n" - " \"Scale\": \"0\",\n" - " \"Bytes\": \"8\"\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"4\",\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" " },\n" - " \"AliasName\": \"c5\",\n" - " \"TableId\": \"0\",\n" - " \"ColId\": \"6\",\n" - " \"ColType\": \"1\",\n" - " \"DbName\": \"test\",\n" - " \"TableName\": \"t1\",\n" - " \"TableAlias\": \"t1\",\n" - " \"ColName\": \"c5\",\n" - " \"DataBlockId\": \"0\",\n" - " \"SlotId\": \"5\"\n" - " }\n" + " {\n" + " \"NodeType\": \"20\",\n" + " \"Name\": \"SlotDesc\",\n" + " \"SlotDesc\": {\n" + " \"SlotId\": \"5\",\n" + " \"DataType\": {\n" + " \"Type\": \"7\",\n" + " \"Precision\": \"0\",\n" + " \"Scale\": \"0\",\n" + " \"Bytes\": \"8\"\n" + " },\n" + " \"Reserve\": false,\n" + " \"Output\": false\n" + " }\n" + " }\n" + " ]\n" " }\n" " }\n" " }\n" - " ]\n" + " }\n" " }\n" "}"; diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index fec6a0574c476ab4654b1b12dbc583ea88063db8..8bf77bdaa98aef4d1e977044dc20ef1c08a9491e 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -58,9 +58,8 @@ int32_t __catalogGetTableHashVgroup(struct SCatalog* pCatalog, void *pRpc, const return mockCatalogService->catalogGetTableHashVgroup(pTableName, vgInfo); } -int32_t __catalogGetTableDistVgInfo(SCatalog* pCatalog, void *pTransporter, const SEpSet* pMgmtEps, const SName* pTableName, SArray** pVgroupList) { - // return mockCatalogService->catalogGetTableDistVgInfo(pTableName, pVgroupList); - return 0; +int32_t __catalogGetTableDistVgInfo(SCatalog* pCtg, void *pRpc, const SEpSet* pMgmtEps, const SName* pTableName, SArray** pVgList) { + return mockCatalogService->catalogGetTableDistVgInfo(pTableName, pVgList); } void initMetaDataEnv() { diff --git a/source/libs/parser/test/mockCatalogService.cpp b/source/libs/parser/test/mockCatalogService.cpp index 00d64bd12ac735c58efbd07290b693185f9ef3ef..a1de7c47a79bda64270b9898925a786113e38392 100644 --- a/source/libs/parser/test/mockCatalogService.cpp +++ b/source/libs/parser/test/mockCatalogService.cpp @@ -126,6 +126,19 @@ public: return 0; } + int32_t catalogGetTableDistVgInfo(const SName* pTableName, SArray** pVgList) const { + SVgroupInfo info = {0}; + info.vgId = 1; + addEpIntoEpSet(&info.epset, "node1", 6030); + + info.hashBegin = 0; + info.hashEnd = 1; + *pVgList = taosArrayInit(4, sizeof(SVgroupInfo)); + + taosArrayPush(*pVgList, &info); + return 0; + } + TableBuilder& createTableBuilder(const std::string& db, const std::string& tbname, int8_t tableType, int32_t numOfColumns, int32_t numOfTags) { builder_ = TableBuilder::createTableBuilder(tableType, numOfColumns, numOfTags); meta_[db][tbname] = builder_->table(); @@ -313,4 +326,8 @@ int32_t MockCatalogService::catalogGetTableMeta(const SName* pTableName, STableM int32_t MockCatalogService::catalogGetTableHashVgroup(const SName* pTableName, SVgroupInfo* vgInfo) const { return impl_->catalogGetTableHashVgroup(pTableName, vgInfo); +} + +int32_t MockCatalogService::catalogGetTableDistVgInfo(const SName* pTableName, SArray** pVgList) const { + return impl_->catalogGetTableDistVgInfo(pTableName, pVgList); } \ No newline at end of file diff --git a/source/libs/parser/test/mockCatalogService.h b/source/libs/parser/test/mockCatalogService.h index b9713316351d458cbf6631480b0881a5fd901858..1f7cd70ac22fb5ac45e98a1b3405babfe0b1ae3f 100644 --- a/source/libs/parser/test/mockCatalogService.h +++ b/source/libs/parser/test/mockCatalogService.h @@ -59,6 +59,7 @@ public: int32_t catalogGetTableMeta(const SName* pTableName, STableMeta** pTableMeta) const; int32_t catalogGetTableHashVgroup(const SName* pTableName, SVgroupInfo* vgInfo) const; + int32_t catalogGetTableDistVgInfo(const SName* pTableName, SArray** pVgList) const; private: std::unique_ptr impl_; diff --git a/source/libs/scalar/test/scalar/scalarTests.cpp b/source/libs/scalar/test/scalar/scalarTests.cpp index 539840639f8101d2268d71dc32fbd52fbee07dec..13c5476a9fc52a4f0448cde479b9b17a4299dde0 100644 --- a/source/libs/scalar/test/scalar/scalarTests.cpp +++ b/source/libs/scalar/test/scalar/scalarTests.cpp @@ -41,6 +41,14 @@ namespace { +SColumnInfo createColumnInfo(int32_t colId, int32_t type, int32_t bytes) { + SColumnInfo info = {0}; + info.colId = colId; + info.type = type; + info.bytes = bytes; + return info; +} + int64_t scltLeftV = 21, scltRightV = 10; double scltLeftVd = 21.0, scltRightVd = 10.0; @@ -914,7 +922,7 @@ TEST(columnTest, smallint_value_add_int_column) { SArray *blockList = taosArrayInit(2, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_DOUBLE, .bytes = sizeof(double)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_DOUBLE, sizeof(double)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, true, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -954,7 +962,7 @@ TEST(columnTest, bigint_column_multi_binary_column) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_DOUBLE, .bytes = sizeof(double)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_DOUBLE, sizeof(double)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -992,7 +1000,7 @@ TEST(columnTest, smallint_column_and_binary_column) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BIGINT, .bytes = sizeof(int64_t)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BIGINT, sizeof(int64_t)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1025,7 +1033,7 @@ TEST(columnTest, smallint_column_or_float_column) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BIGINT, .bytes = sizeof(int64_t)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BIGINT, sizeof(int64_t)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, true, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1058,7 +1066,7 @@ TEST(columnTest, smallint_column_or_double_value) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BIGINT, .bytes = sizeof(int64_t)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BIGINT, sizeof(int64_t)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, true, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1091,7 +1099,7 @@ TEST(columnTest, smallint_column_greater_double_value) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, true, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1131,7 +1139,7 @@ TEST(columnTest, int_column_in_double_list) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, true, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1190,7 +1198,7 @@ TEST(columnTest, binary_column_in_binary_list) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1234,7 +1242,7 @@ TEST(columnTest, binary_column_like_binary) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1276,7 +1284,7 @@ TEST(columnTest, binary_column_is_true) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1320,7 +1328,7 @@ TEST(columnTest, binary_column_is_null) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1363,7 +1371,7 @@ TEST(columnTest, binary_column_is_not_null) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&opNode, dataBlockId, slotId, opNode); @@ -1405,7 +1413,7 @@ TEST(columnTest, greater_and_lower) { SArray *blockList = taosArrayInit(1, POINTER_BYTES); taosArrayPush(blockList, &src); - SColumnInfo colInfo = {.colId = 1, .type = TSDB_DATA_TYPE_BOOL, .bytes = sizeof(bool)}; + SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_BOOL, sizeof(bool)); int16_t dataBlockId = 0, slotId = 0; scltAppendReservedSlot(blockList, &dataBlockId, &slotId, false, rowNum, &colInfo); scltMakeTargetNode(&logicNode, dataBlockId, slotId, logicNode);