gianm opened a new pull request, #20593:
URL: https://github.com/apache/druid/pull/20593

   This patch adds the ability for SQL UNION to run over relations that involve 
projections and filters of base tables, such as:
   
   ```
     SELECT dim1, SUM(m1), COUNT(*)
     FROM (SELECT dim1, m1 FROM foo2 WHERE dim1 = '1'
           UNION ALL
           SELECT dim1, m1 FROM foo)
     GROUP BY 1;
   ```
   
   Such queries are planned into stacks of the existing "filter" datasource and 
the new "project" datasource.
   
   Other changes, outside the SQL planner:
   
   1) DataSource method "createSegmentPruner" has DimFilter and
      VirtualColumns added as parameters. This enables DataSource
      implementations, such as FilteredDataSource and ProjectDataSource,
      to rewrite the filter and contribute additional virtual columns to
      the pruning logic. ExecutionVertex#isBaseColumn is removed and more
      scenarios are now pruneable.
   
   2) DataSource gets "getReservedColumns" with a set of column names to
      avoid when generating higher-level virtual columns. This is used
      by the SQL planner to avoid name collisions.
   
   3) DataSource gets "mayFilterRows", which allows time-boundary queries
      to properly recognize that filtering DataSources should go down the
      "query has filter" path.
   
   4) Fix an issue where various CursorHolder implementations return
      lists from "getOrdering" that erroneously include base columns
      which were shadowed by virtual columns.
   
   5) Updates to MSQ to call the new ExecutionVertex#splitUnion and
      splitUnionSegmentMapFunctions methods to provide each arm with its
      own SegmentPruner and  SegmentMapFunction.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to