Skip to content

Commit

Permalink
Convert values node followed by false filter to empty values node
Browse files Browse the repository at this point in the history
  • Loading branch information
feilong-liu authored and NikhilCollooru committed Nov 1, 2023
1 parent a4d40df commit 66aab8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ public PlanOptimizers(
new ImplementBernoulliSampleAsFilter(metadata.getFunctionAndTypeManager()),
new ImplementOffset(metadata.getFunctionAndTypeManager()))),
simplifyRowExpressionOptimizer,
new IterativeOptimizer(
metadata,
ruleStats,
statsCalculator,
estimatedExchangesCostCalculator,
ImmutableSet.of(new RemoveTrivialFilters())),
new UnaliasSymbolReferences(metadata.getFunctionAndTypeManager()),
new IterativeOptimizer(
metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ public void testSimplifyJoinWithEmptyInput()
assertPlanWithSession(
"SELECT C, orderkey FROM (select orderkey as C from orders where 1=0) join orders on 1=1",
disableEmptyJoinOptimization, true,
output(node(JoinNode.class, values("orderkey_0"), values("orderkey_3"))));
output(node(JoinNode.class, values("orders"), anyTree(tableScan("orders")))));
}

@Test
Expand Down

0 comments on commit 66aab8b

Please sign in to comment.