Barry Kelly created CALCITE-6337:
------------------------------------

             Summary: Distinguish naked measure support between inside and 
outside aggregation
                 Key: CALCITE-6337
                 URL: https://issues.apache.org/jira/browse/CALCITE-6337
             Project: Calcite
          Issue Type: Improvement
          Components: core
            Reporter: Barry Kelly


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




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to