Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,20 @@ private Optional<Pair<Cost, GroupExpression>> getCost(CascadesContext currentCtx
// set subtree rewrite cache
currentCtx.getStatementContext().getRewrittenCteProducer()
.put(currentCtx.getCurrentTree().orElse(null), (LogicalPlan) cboCtx.getRewritePlan());
// Do post tree rewrite
CascadesContext rootCtxCopy = CascadesContext.newCurrentTreeContext(rootCtx);
Rewriter.getWholeTreeRewriterWithoutCostBasedJobs(rootCtxCopy).execute();
// Do optimize
new Optimizer(rootCtxCopy).execute();
return rootCtxCopy.getMemo().getRoot().getLowestCostPlan(
rootCtxCopy.getCurrentJobContext().getRequiredProperties());
} else {
// Do post tree rewrite
CascadesContext cboCtxCopy = CascadesContext.newCurrentTreeContext(cboCtx);
// Do optimize
new Optimizer(cboCtxCopy).execute();
return cboCtxCopy.getMemo().getRoot().getLowestCostPlan(
cboCtxCopy.getCurrentJobContext().getRequiredProperties());
}
// Do post tree rewrite
CascadesContext rootCtxCopy = CascadesContext.newCurrentTreeContext(rootCtx);
Rewriter.getWholeTreeRewriterWithoutCostBasedJobs(rootCtxCopy).execute();
// Do optimize
new Optimizer(rootCtxCopy).execute();
return rootCtxCopy.getMemo().getRoot().getLowestCostPlan(
rootCtxCopy.getCurrentJobContext().getRequiredProperties());
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions regression-test/data/shape_check/tpcds_sf100/rf_prune/query8.out

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions regression-test/data/shape_check/tpcds_sf100/shape/query8.out

Large diffs are not rendered by default.

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions regression-test/data/shape_check/tpcds_sf1000/hint/query8.out

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions regression-test/data/shape_check/tpcds_sf1000/shape/query8.out

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions regression-test/data/shape_check/tpcds_sf10t_orc/shape/query8.out

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ PhysicalResultSink
--------PhysicalProject
----------hashJoin[INNER_JOIN broadcast] hashCondition=((T.l_linenumber = expr_cast(r_regionkey as BIGINT))) otherCondition=() build RFs:RF0 expr_cast(r_regionkey as BIGINT)->[cast(l_linenumber as BIGINT),o_orderkey]
------------PhysicalExcept
--------------hashAgg[GLOBAL]
----------------PhysicalDistribute[DistributionSpecHash]
------------------hashAgg[LOCAL]
--------------------PhysicalProject
----------------------PhysicalOlapScan[lineitem] apply RFs: RF0
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------PhysicalOlapScan[lineitem] apply RFs: RF0
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------PhysicalOlapScan[orders] apply RFs: RF0
----------------hashAgg[LOCAL]
------------------PhysicalProject
--------------------PhysicalOlapScan[orders] apply RFs: RF0
------------PhysicalProject
--------------PhysicalOlapScan[region]

Expand All @@ -25,12 +28,15 @@ PhysicalResultSink
----------hashJoin[INNER_JOIN broadcast] hashCondition=((expr_abs(l_linenumber) = expr_cast(r_regionkey as LARGEINT))) otherCondition=() build RFs:RF0 expr_cast(r_regionkey as LARGEINT)->[abs(cast(l_linenumber as BIGINT)),abs(o_orderkey)]
------------PhysicalProject
--------------PhysicalExcept
----------------hashAgg[GLOBAL]
------------------PhysicalDistribute[DistributionSpecHash]
--------------------hashAgg[LOCAL]
----------------------PhysicalProject
------------------------PhysicalOlapScan[lineitem] apply RFs: RF0
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalOlapScan[lineitem] apply RFs: RF0
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalOlapScan[orders] apply RFs: RF0
------------------hashAgg[LOCAL]
--------------------PhysicalProject
----------------------PhysicalOlapScan[orders] apply RFs: RF0
------------PhysicalProject
--------------PhysicalOlapScan[region]

Loading