Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-1921

Support Grouping Funtions

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: v1.5.3
    • Fix Version/s: v1.5.4
    • Component/s: Query Engine
    • Labels:
      None

      Description

      Usually we used 'group by dim1, dim2' to fetch the metrics with every value of dims, and we also want the summary metrics with the dim2 rolled up.
      This case could be resolved by union two query, like:

      select dim1, dim2 metric from table group by dim1, dim2
      union all
      select dim1, 'ALL', metric from table group by dim1
      

      Now with the expression cube/rollup/grouping sets in calcite, we can make the query sql more simple and more clearly:

      select dim1, case(grouping(dim2) when 1 then 'ALL' else dim2 end), metric
      from table
      group by grouping sets((dim1, dim2), (dim1))
      

        Attachments

        1. KYLIN-1921.2.patch
          36 kB
          Yerui Sun
        2. KYLIN-1921.patch
          37 kB
          Yerui Sun

          Activity

            People

            • Assignee:
              sunyerui Yerui Sun
              Reporter:
              sunyerui Yerui Sun
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: