Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
As discussed in comments Currently, PushLocalHashAggIntoScanRule match for the Exchange -> LocalHashAggregate -> Scan. As a result, the following pattern can not be optimized
+- Union(all=[true], union=[type, sum$0]) :- Union(all=[true], union=[type, sum$0]) : :- LocalHashAggregate(groupBy=[type], select=[type, Partial_SUM(price) AS sum$0]) : : +- TableSourceScan(table=[[default_catalog, default_database, table1, project=[type, price], metadata=[]]], fields=[type, price]) : +- LocalHashAggregate(groupBy=[type], select=[type, Partial_SUM(price) AS sum$0]) : +- TableSourceScan(table=[[default_catalog, default_database, table2, project=[type, price], metadata=[]]], fields=[type, price]) +- LocalHashAggregate(groupBy=[type], select=[type, Partial_SUM(price) AS sum$0]) +- TableSourceScan(table=[[default_catalog, default_database, table3, project=[type, price], metadata=[]]], fields=[type, price])
We should extend the rule to support this pattern.