Skip to content

docs(core-spec): Reserve AGG() in Ossie SQL - #662

Open
justint-db wants to merge 1 commit into
apache:mainfrom
justint-db:reserve-agg
Open

justint-db wants to merge 1 commit into
apache:mainfrom
justint-db:reserve-agg

Conversation

@justint-db

@justint-db justint-db commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Reserve AGG. Ossie SQL reserves the function name AGG for evaluating a measure, as defined by the Relational Query Interface (Sections 4 and 6). Implementations and dialect extensions must not give it another meaning. This change reserves the name only. Where model declarations may use AGG is left to a future version (docs(core-spec): Let dataset-scoped metrics reference source columns as source.column #633 proposes one use).
  • Compatibility note. Earlier versions did not reserve AGG, so an older OSSIE_SQL_2026 expression might call a different function by that name. Fields, metrics, and columns can still be named agg.
  • Function names should be case insensitive, matching the existing rule for regular identifiers. As suggested on the list, this is stated as a general rule, so it also covers existing functions.

Only core-spec/expression_language.md changes.

Related Issues

Split from #633.

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue
  • Breaking changes to the spec are clearly called out in the summary (see the compatibility note)

Reserve the function name AGG for measure evaluation, as defined by the
Relational Query Interface, and add a compatibility note for older
expressions that call a different function named AGG. State that
function names should be case insensitive, like regular identifiers.

Where model declarations may use AGG is left to a future version.

Co-authored-by: Isaac <[email protected]>

@jbonofre jbonofre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @justint-db, this matches what we agreed on the dev@ mailing list (split from #633 ):

  • AGG is reserved in Ossie SQL, with a compatibility note for existing expressions calling another function named AGG
  • function names are case insensitive, so agg() and Agg() are covered too
  • function names and identifiers are separate namespaces, so a field or metric named agg still works
  • where model declarations can use AGG (dataset scoped metric, AGG over a source measure) stays in #633

A few non-blocking points we can address later:

  1. The compatibility note suggests moving an older AGG call to a vendor dialect, but the new section says a dialect extension MUST NOT define AGG. As vendor dialects are opaque (spec.md), I think the reservation should apply to OSSIE_SQL_2026 expression only.
  2. It would be good to say explicitly that AGG(...) is not allowed in OSSIE_SQL_2026 model expressions until a future version defines where it can be used (maybe in the "Not Supported in Expressions" table).
  3. Functions callable without parentheses (CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP) can collide with a field of the same name. Worth an exception in the "separate namespaces" sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants