From 46a6d9ab991f882673546fc9d1946f5661a39c61 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sun, 30 Oct 2022 22:23:27 +0800 Subject: [PATCH] refactor: do some internal refactor. --- source/libs/executor/inc/executil.h | 6 +++++- source/libs/executor/inc/executorimpl.h | 4 ---- source/libs/executor/src/executil.c | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/libs/executor/inc/executil.h b/source/libs/executor/inc/executil.h index 306b7443b5..31492cafa8 100644 --- a/source/libs/executor/inc/executil.h +++ b/source/libs/executor/inc/executil.h @@ -23,6 +23,7 @@ #include "tpagedbuf.h" #include "tsimplehash.h" #include "vnode.h" +#include "executor.h" #define T_LONG_JMP(_obj, _c) \ do { \ @@ -98,7 +99,10 @@ typedef struct SColMatchInfo { typedef struct STableListInfo STableListInfo; struct SqlFunctionCtx; -STableListInfo*tableListCreate(); +int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags, bool groupSort, SReadHandle* pHandle, + STableListInfo* pTableListInfo, SNode* pTagCond, SNode* pTagIndexCond, const char* id); + +STableListInfo* tableListCreate(); void* tableListDestroy(STableListInfo* pTableListInfo); void tableListClear(STableListInfo* pTableListInfo); int32_t tableListGetOutputGroups(const STableListInfo* pTableList); diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index cd80032a71..cad4b562b8 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -1065,10 +1065,6 @@ uint64_t calGroupIdByData(SPartitionBySupporter* pParSup, SExprSupp* pExprSup, S int32_t finalizeResultRows(SDiskbasedBuf* pBuf, SResultRowPosition* resultRowPosition, SExprSupp* pSup, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo); -int32_t createScanTableListInfo(SScanPhysiNode* pScanNode, SNodeList* pGroupTags, bool groupSort, SReadHandle* pHandle, - STableListInfo* pTableListInfo, SNode* pTagCond, SNode* pTagIndexCond, - const char* idstr); - SOperatorInfo* createGroupSortOperatorInfo(SOperatorInfo* downstream, SGroupSortPhysiNode* pSortPhyNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanNode, STableListInfo* pTableListInfo, diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index d5b0d27ad5..d6ec44c4df 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -1695,6 +1695,7 @@ uint64_t getTableGroupId(const STableListInfo* pTableList, uint64_t tableUid) { return pKeyInfo->groupId; } +// TODO handle the group offset info, fix it, the rule of group output will be broken by this function int32_t tableListAddTableInfo(STableListInfo* pTableList, uint64_t uid, uint64_t gid) { if (pTableList->map == NULL) { ASSERT(taosArrayGetSize(pTableList->pTableList) == 0);