Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Currently when inferring predicates for Aggregate, Calcite only pulls up existing predicates, and it can only do that for columns that are part of the group key. This feature would infer predicates based on the behavior of aggregate functions and, sometimes, predicates of the arguments to those functions.
Examples:
- count(*) and count(x) are always > 0 (if groups are non-empty, and x is not null)
- count(*) and count(x) are always >= 0
- sum(x) is >= 0 (if x is >= 0; it's OK if x is sometimes null)
- min(x) and max(x) have the same upper and lower bounds as x
Attachments
Issue Links
- relates to
-
CALCITE-1366 Metadata provider should not pull predicates up through GROUP BY ()
- Closed