Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

MBQL 1.3.1

Compare
Choose a tag to compare
@camsaul camsaul released this 12 Jul 19:46
· 16 commits to master since this release
a1d46ff

Replace :named aggregation clauses with new :aggregation-options clause.

Prior to Metabase 0.33.0, you could specifiy custom names for aggregations in MBQL by wrapping the clause in a
:named clause:

[:named [:count] \"My Count\"]

This name was used for both the :display_name in the query results, and for the :name used as an alias in the query (e.g. the right-hand side of a SQL AS expression). Because some custom display names weren't allowed by some drivers, or would be transformed in some way (for example, Redshift always lowercases custom aliases), this method was needed so we could match the name we had given the column with the one in the query results.

In 0.33.0, we started using :named internally to alias aggregations in middleware in all queries to prevent issues with referring to multiple aggregations of the same type when that query was used as a source query. See #9767 for more details. After this change, it became desirable to differentiate between such internally-generated aliases and display names, which need not be used in the query at all; thus in MBQL 1.3.x :named was replaced by the more general :aggregation-options. Because user-generated names are no longer used as aliases in native queries themselves, this method is no longer needed and will be removed in a future release.