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

Distinguish naked measure support between inside and outside aggregation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.37.0
    • core

    Description

      Measure type and AGGREGATE function (CALCITE-5105) introduced a configuration flag for naked measures.

      Naked measures are measure-typed columns that are referenced outside an AGGREGATE() function call.

      At Looker, we're trying to support a specific semantic using measure-typed columns:

      • selecting from a naked measure-typed column outside an aggregating query evaluates to NULL
        This permits basic introspection of the schema like `SELECT * FROM foo LIMIT 1`
        For this, we need naked measures outside a grouping context.
      • selecting from a naked measure-typed column inside an aggregating query is an error
        We want all expressions in a grouping query to either be part of the grouping key or to have
        an aggregation function applied. For this, we don't want naked measures inside a grouping context.

      This change proposes:

      • nakedMeasuresOutsideAggregatingQuery - boolean flag permitting measure references outside aggregating query
      • nakedMeasuresInsideAggregatingQuery - boolean flag permitting measure references inside aggregating query
      • deprecating nakedMeasures flag, which is now implemented by setting both of the above to the same value

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              barrkel Barry Kelly
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: