Skip to content

Commit

Permalink
Fix multiple consecutive Exchange returning empty response (apache#11885
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Jackie-Jiang authored Oct 27, 2023
1 parent 5d58102 commit 6853991
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ public PlanNode visitExchange(ExchangeNode node, Context context) {
}
int currentPlanFragmentId = context._previousPlanFragmentId;
int nextPlanFragmentId = ++context._currentPlanFragmentId;
// Set previous PlanFragment ID in the context to be the next PlanFragment ID to be used by the child node.
context._previousPlanFragmentId = nextPlanFragmentId;
PlanNode nextPlanFragmentRoot = node.getInputs().get(0).visit(this, context);

PinotRelExchangeType exchangeType = node.getExchangeType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@
["b", true, true, 2, 1]
]
},
{
"description": "multi 'with' table with multiple semi-joins",
"sql": "WITH t1 AS ( SELECT * FROM {tbl1} WHERE intCol > 1 ), t2 AS ( SELECT * FROM {tbl2} WHERE strCol1 IN (SELECT strCol FROM t1) AND intCol > 2 ) SELECT strCol1, strCol2, intCol FROM t2 WHERE strCol1 IN (SELECT strCol FROM t1)",
"outputs": [
["b", "alice", 42],
["b", "bob", 196883]
]
},
{
"description": "nested 'with' on agg table: (with a as ( ... ), select ... ",
"sql": "WITH agg1 AS (SELECT strCol1, strCol2, sum(intCol) AS sumVal FROM {tbl2} GROUP BY strCol1, strCol2) SELECT strCol1, avg(sumVal) AS avgVal FROM agg1 GROUP BY strCol1",
Expand Down

0 comments on commit 6853991

Please sign in to comment.