For the following query:
select a, min(distinct b), bit_or(distinct c) from foo group by a;
Currently Calcite still preserve the distinct for these aggregate functions, but DISTINCT is not meaningful with MIN/MAX and is available for ISO compatibility only. We can safely remove distinct and get more optimization opportunities.
- links to