Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1368

Infer predicates for aggregate functions

    XMLWordPrintableJSON

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

          Activity

            People

              Unassigned Unassigned
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: