rusackas opened a new pull request, #44879:
URL: https://github.com/apache/superset/pull/44879
### SUMMARY
TDD/investigation PR for #40482 ("'group by all' is not working in Superset
SQL Lab with ClickHouse DB"), which has no error text, no repro steps, and has
sat without confirmation since May (labeled `requires:more-info`).
Before writing this test I verified Superset's own SQL-mutation layer
directly: sqlglot parses ClickHouse's `GROUP BY ALL` as `Group(all=True)` and
round-trips it cleanly, and `SQLStatement.set_limit_value` (the LIMIT-injection
path SQL Lab always runs) operates on that AST node directly — confirmed by
actually running `SQLScript`/`set_limit_value` against a `GROUP BY ALL` query
for the `clickhousedb` engine locally; it renders correctly both before and
after LIMIT injection.
That leaves one layer that can't be verified by reading code: whether the
real driver/server combination Superset ships (`clickhouse-connect` over HTTP)
actually executes `GROUP BY ALL` correctly. This adds a testcontainers
regression that creates a table, inserts rows with duplicate grouping keys,
runs a raw `GROUP BY ALL` query through the real engine, and asserts the
grouped/summed results are correct.
A green run here is strong evidence the reported issue is stale (possibly
fixed by one of the ClickHouse-related changes that have landed since May, or
never reproducible in the first place). A red run would isolate the bug to the
driver/server layer specifically, rather than Superset's query handling, giving
a concrete starting point for a real fix.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — test-only change.
### TESTING INSTRUCTIONS
CI's `Testcontainers` workflow runs this against a real
`clickhouse/clickhouse-server` container (see
`tests/testcontainers/db_engine_specs/test_clickhouse.py::test_group_by_all_groups_correctly`).
Locally, with Docker available:
```bash
pytest tests/testcontainers/db_engine_specs/test_clickhouse.py -m
testcontainers -k group_by_all -v
```
### ADDITIONAL INFORMATION
- [x] Has associated issue: #40482
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]