Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-31260

PushLocalHashAggIntoScanRule should also work with union RelNode

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Table SQL / Planner
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            aitozi WenJun Min
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: