Skip to content

Commit

Permalink
fix: set parent order
Browse files Browse the repository at this point in the history
  • Loading branch information
facetosea committed Jan 5, 2025
1 parent 85907ab commit 0ba9e36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/libs/planner/src/planOptimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "functionMgt.h"
#include "parser.h"
#include "planInt.h"
#include "plannodes.h"
#include "systable.h"
#include "tglobal.h"
#include "ttime.h"
Expand Down Expand Up @@ -211,7 +212,7 @@ static void optSetParentOrder(SLogicNode* pNode, EOrder order, SLogicNode* pNode
case QUERY_NODE_LOGIC_PLAN_SORT:
case QUERY_NODE_LOGIC_PLAN_FILL:
if (pNode == pNodeForcePropagate) {
pNode->outputTsOrder = order;
pNode->outputTsOrder = pNodeForcePropagate->outputTsOrder;
break;
} else
return;
Expand All @@ -226,8 +227,10 @@ static void optSetParentOrder(SLogicNode* pNode, EOrder order, SLogicNode* pNode
break;
case QUERY_NODE_LOGIC_PLAN_PROJECT:
pChild = (SLogicNode*)nodesListGetNode(((SProjectLogicNode*)pNode)->node.pChildren, 0);
if (pChild && DATA_ORDER_LEVEL_GLOBAL != pChild->resultDataOrder) {
if (pChild && (DATA_ORDER_LEVEL_IN_BLOCK == pChild->resultDataOrder ||
DATA_ORDER_LEVEL_IN_GROUP == pChild->resultDataOrder)) {
pNode->outputTsOrder = TSDB_ORDER_NONE;
optSetParentOrder(pNode->pParent, TSDB_ORDER_NONE, pNodeForcePropagate);
return;
}
pNode->outputTsOrder = order;
Expand Down

0 comments on commit 0ba9e36

Please sign in to comment.