From 5e50bf8dc88f9a2e97f108886d9b80d1b26f22a2 Mon Sep 17 00:00:00 2001 From: "slzhou@taodata.com" Date: Tue, 12 Jul 2022 09:24:57 +0800 Subject: [PATCH] fix: avoid tag scan when scan cols is not empty --- source/libs/planner/src/planOptimizer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 2d57972fdd..1548ab0ee3 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2090,7 +2090,10 @@ static bool tagScanMayBeOptimized(SLogicNode* pNode) { if (QUERY_NODE_LOGIC_PLAN_SCAN != nodeType(pNode) || (SCAN_TYPE_TAG == ((SScanLogicNode*)pNode)->scanType)) { return false; } - + SScanLogicNode *pScan = (SScanLogicNode*)pNode; + if (NULL != pScan->pScanCols) { + return false; + } if (NULL == pNode->pParent || QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode->pParent) || 1 != LIST_LENGTH(pNode->pParent->pChildren)) { return false; } -- GitLab