Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
The Filter could be pushed past the Sample.
For example:
select deptno from "scott".dept tablesample system(50) where deptno > 10
The plan tree is :
LogicalProject(o_orderkey=[$0]) LogicalFilter(condition=[>($0, 0)]) Sample(mode=[system], rate=[0.5], repeatableSeed=[-]) LogicalTableScan(table=[[tpch, ORDERS]])
Could be rewrite to :
LogicalProject(o_orderkey=[$0]) Sample(mode=[system], rate=[0.5], repeatableSeed=[-]) LogicalFilter(condition=[>($0, 0)]) LogicalTableScan(table=[[tpch, ORDERS]])
The same logic could see Presto/Trino: PredicatePushDown.Rewriter#visitSample
Attachments
Issue Links
- links to