[ 
https://issues.apache.org/jira/browse/IGNITE-25578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Evgeny Stanilovsky reassigned IGNITE-25578:
-------------------------------------------

    Assignee: Evgeny Stanilovsky

> Sql. Add tests for GROUP BY ROLLUP / CUBE
> -----------------------------------------
>
>                 Key: IGNITE-25578
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25578
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql ai3
>            Reporter: Maksim Zhuravkov
>            Assignee: Evgeny Stanilovsky
>            Priority: Major
>              Labels: ignite-3
>
> The sql runtime supports both GROUP BY ROLLUP and GROUP BY CUBE but the tests 
> are missing.
> Example:
> {noformat}
> CREATE TABLE sales(customer_id int, product_id int, qty int, price int, id 
> int primary key);
> INSERT INTO sales VALUES(1, 100, 1, 50, 1);
> INSERT INTO sales VALUES(2, 100, 3, 25, 2);
> INSERT INTO sales VALUES(1, 120, 1, 10, 3);
> -- ROLLUP
> SELECT customer_id, sum(qty*price) FROM sales GROUP BY ROLLUP (customer_id, 
> product_id) ORDER BY customer_id, product_id;
> ╔═════════════╤══════════════════╗
> ║ CUSTOMER_ID │ SUM(QTY * PRICE) ║
> ╠═════════════╪══════════════════╣
> ║ 1           │ 50               ║
> ╟─────────────┼──────────────────╢
> ║ 1           │ 10               ║
> ╟─────────────┼──────────────────╢
> ║ 1           │ 60               ║
> ╟─────────────┼──────────────────╢
> ║ 2           │ 75               ║
> ╟─────────────┼──────────────────╢
> ║ 2           │ 75               ║
> ╟─────────────┼──────────────────╢
> ║ null        │ 135              ║
> ╚═════════════╧══════════════════╝
> -- CUBE
> SELECT customer_id, sum(qty*price) FROM sales GROUP BY CUBE (customer_id, 
> product_id) ORDER BY customer_id, product_id;
> ╔═════════════╤══════════════════╗
> ║ CUSTOMER_ID │ SUM(QTY * PRICE) ║
> ╠═════════════╪══════════════════╣
> ║ 1           │ 50               ║
> ╟─────────────┼──────────────────╢
> ║ 1           │ 10               ║
> ╟─────────────┼──────────────────╢
> ║ 1           │ 60               ║
> ╟─────────────┼──────────────────╢
> ║ 2           │ 75               ║
> ╟─────────────┼──────────────────╢
> ║ 2           │ 75               ║
> ╟─────────────┼──────────────────╢
> ║ null        │ 125              ║
> ╟─────────────┼──────────────────╢
> ║ null        │ 10               ║
> ╟─────────────┼──────────────────╢
> ║ null        │ 135              ║
> ╚═════════════╧══════════════════╝
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to