Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cubesql): Rollup don't work over subquery with asterisk projection #8354

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/cubejs-testing-drivers/fixtures/athena.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@
"SQL API: Nested Rollup",
"SQL API: Rollup with aliases",
"SQL API: Rollup over exprs",
"SQL API: Nested Rollup with aliases"
"SQL API: Nested Rollup with aliases",
"SQL API: Nested Rollup over asterisk",
"SQL API: Extended nested Rollup over asterisk"
]
}
4 changes: 3 additions & 1 deletion packages/cubejs-testing-drivers/fixtures/bigquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@
"---------------------------------------",
"SQL API: reuse params",
"SQL API: Complex Rollup",
"SQL API: Rollup with aliases"
"SQL API: Rollup with aliases",
"SQL API: Nested Rollup over asterisk",
"SQL API: Extended nested Rollup over asterisk"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@
"SKIPPED SQL API (Need work)",
"---------------------------------------",
"SQL API: Nested Rollup",
"SQL API: Nested Rollup with aliases"
"SQL API: Nested Rollup with aliases",
"SQL API: Nested Rollup over asteriks",
"SQL API: Extended nested Rollup over asterisk"
]
}
4 changes: 3 additions & 1 deletion packages/cubejs-testing-drivers/fixtures/mssql.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
"SQL API: Nested Rollup",
"SQL API: Rollup with aliases",
"SQL API: Rollup over exprs",
"SQL API: Nested Rollup with aliases"
"SQL API: Nested Rollup with aliases",
"SQL API: Nested Rollup over asterisk",
"SQL API: Extended nested Rollup over asterisk"
]
}
4 changes: 3 additions & 1 deletion packages/cubejs-testing-drivers/fixtures/mysql.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
"SQL API: Nested Rollup",
"SQL API: Rollup with aliases",
"SQL API: Rollup over exprs",
"SQL API: Nested Rollup with aliases"
"SQL API: Nested Rollup with aliases",
"SQL API: Nested Rollup over asterisk",
"SQL API: Extended nested Rollup over asterisk"
]
}
34 changes: 34 additions & 0 deletions packages/cubejs-testing-drivers/src/tests/testQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1771,5 +1771,39 @@ from
`);
expect(res.rows).toMatchSnapshot('nested_rollup_with_aliases');
});
executePg('SQL API: Nested Rollup over asterisk', async (connection) => {
const res = await connection.query(`
select rowId as "row", orderId as "order", orderDate as "date", sum(count)
from (
select *
from
"ECommerce" as "ECommerce"
) a
group by
ROLLUP(1, 2, 3)
order by 1, 2, 3

`);
expect(res.rows).toMatchSnapshot('nested_rollup_over_asterisk');
});
executePg('SQL API: Extended nested Rollup over asterisk', async (connection) => {
const res = await connection.query(`
select * from (
select * from (
select rowId as "row", orderId as "order", sum(count)
from (
select *
from
"ECommerce" as "ECommerce"
) a
group by
ROLLUP(row, order)
ORDER BY "rowId" ASC NULLS FIRST, "orderId" ASC NULLS FIRST OFFSET 0 ROWS FETCH FIRST 100 ROWS ONLY
) q1
) q2 limit 100

`);
expect(res.rows).toMatchSnapshot('extended_nested_rollup_over_asterisk');
});
});
}
Loading
Loading