You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2022/04/26 22:16:00 UTC

[jira] [Commented] (CALCITE-5105) Add MEASURE type and AGGREGATE aggregate function

    [ https://issues.apache.org/jira/browse/CALCITE-5105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17528435#comment-17528435 ] 

Julian Hyde commented on CALCITE-5105:
--------------------------------------

The dev branch [julianhyde/5105-measure-ref|https://github.com/julianhyde/calcite/tree/5105-measure-ref] is in good shape and ready for review. [~mkou], can you take a look?

After this is complete we will rebase the dev branch for CALCITE-4496 onto it, because this is a subset of the 'measures in SQL' epic.

> Add MEASURE type and AGGREGATE aggregate function
> -------------------------------------------------
>
>                 Key: CALCITE-5105
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5105
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>
> In CALCITE-4496 we propose adding measures to SQL, and an "AS MEASURE" sub-clause to the SELECT clause so that you can define measures. This change is a first step in that direction: namely the ability to define the columns are measures and use validate queries that use measures.
> This change adds a {{MEASURE}} type, which is parameterized with the value type, so that in RelNode-and-RexNode-land a measure column whose value is of type {{INTEGER}} would have type {{MEASURE<INTEGER>}}. (In SqlNode-land its type would be {{INTEGER}} and we would tell that it was a measure by some other means.)
> This change also adds an aggregate function called {{AGGREGATE}} that evaluates measures in the current {{GROUP BY}} context. (You can think of this as letting the measures roll themselves up as only they know how. For example, if the {{sum_price}} measure is defined as {{SUM(price)}} then if I write {{AGGREGATE(sum_price)}} in my query it's as if I wrote {{SUM(price)}}. But we also support measures that have more complex formulas.)



--
This message was sent by Atlassian Jira
(v8.20.7#820007)