apache / apache/beam

Support GROUP BY ROLLUP

Open
#20,879 0 comments 0 reactions 0 assignees View on GitHub
dsl new feature P3 sql
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

From https://lists.apache.org/thread.html/r49f3dbfb333d1e23ebb32f35d3c1ff9aaae75019649299887302cf9b%40%3Cuser.beam.apache.org%3E

I was trying to use “GROUP BY WITH ROLLUP” (2.29.0 version) which I saw here - [https://beam.apache.org/documentation/dsls/sql/calcite/query-syntax/#](https://beam.apache.org/documentation/dsls/sql/calcite/query-syntax/#)

"select warehouse, SUM(quantity) as quantity from PCOLLECTION group by ROLLUP(warehouse)"));

Warehouse | quantity

\--\--\--\--\--\--\--\--\--\--\--\--\--\---

Melbourne | 100

New York | 200

New York | 200

Output below seems to ignore ROLLUP.

Warehouse | quantity

\--\--\--\--\--\--\--\--\--\--\--\--\--\--\---

Melbourne | 100

New York | 400

Warehouse_Total | 500 =\> not generated

Could you please confirm if this is supported or I am missing something.

I tried to search JIRA/documentation to get some pointers but could not find.

Imported from Jira [BEAM-12288](https://issues.apache.org/jira/browse/BEAM-12288). Original Jira may contain additional context.
Reported by: apilloud.

Contributor guide

Open the contributing guide

Research direction

Start with the linked Calcite query-syntax documentation and the original BEAM-12288 Jira issue, then reproduce the GROUP BY ROLLUP query against Beam SQL 2.29.0. Done means the query is confirmed as supported and produces the expected warehouse subtotal and grand-total rows, or the documentation clearly records its limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
data-engineering, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.