sbroeder opened a new pull request, #5382:
URL: https://github.com/apache/calcite/pull/5382

   Add AggregateUnionNullBranchRule as CoreRules.AGGREGATE_UNION_NULL_BRANCH. A 
UNION ALL branch is irrelevant to an enclosing aggregate when every aggregate 
call ignores NULLs, for example, SUM, SUM0, MIN, MAX, AVG, COUNT(col), and 
reads a column that the branch produces as constant NULL.
   
   Without GROUP BY the branch is removed, but at least one branch is kept. 
With GROUP BY the branch is kept because it contributes group keys, but a 
redundant pure GROUP BY inside it is removed.
   
   COUNT(*), other aggregates, and UNION distinct are not affected.
   
   ## Jira Link
   [CALCITE-7912](https://issues.apache.org/jira/browse/CALCITE-7912)
   


-- 
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]

  • [PR] [CALCITE-7912] Prune UNI... sbroeder (via GitHub) via commits

Reply via email to