zed icon indicating copy to clipboard operation
zed copied to clipboard

Error "no corresponding grouping element for non-aggregate" with ClickBench q34

Open philrz opened this issue 9 months ago • 0 comments

tl;dr

The ClickBench q34 SQL is currently rejected by SuperDB though it was previously accepted and would produce the correct result in the past.

$ super -version
Version: 6833db0f5

$ SUPER_VAM=1 super -c "
SELECT 1,
       URL,
       COUNT(*) AS c
FROM 'data.parquet'
GROUP BY 1,
         URL
ORDER BY c DESC
LIMIT 10;"
no corresponding grouping element for non-aggregate "1" at line 2, column 8:
SELECT 1,
       ~

Details

Repro is with super commit 6833db0 (which is associated with the changes in #5938) and the attached data.parquet.gz, which is a small subset of the overall ClickBench test data.

At the commit that came right before the merge of #5938, this query ran fine.

$ SUPER_VAM=1 super -c "
SELECT 1,
       URL,
       COUNT(*) AS c
FROM 'data.parquet'
GROUP BY 1,
         URL
ORDER BY c DESC
LIMIT 10;"

{"1":1,URL:null(string),c:5(uint64)}
{"1":1,URL:"http://bonprix.ru/index.ru/cinema/art/0 986 424 233 сезон",c:1(uint64)}
{"1":1,URL:"http://bonprix.ru/index.ru/cinema/art/A00387,3797); ru)&bL",c:1(uint64)}
{"1":1,URL:"http://tours/Ekategoriya%2F&sr=http://slovareniye",c:1(uint64)}
{"1":1,URL:"http://afisha.mail.ru/catalog/314/women.ru/ency=1&page3/?errovat-pinniki",c:1(uint64)}
{"1":1,URL:"http://holodilnik.ru/russia/05jul2013&model=0",c:1(uint64)}

Other SQL systems like ClickHouse and DuckDB accept this SQL without complaint.

$ clickhouse --version
ClickHouse local version 25.5.2.47 (official build).

$ clickhouse --query "
SELECT 1,
       URL,
       COUNT(*) AS c
FROM 'data.parquet'
GROUP BY 1,
         URL
ORDER BY c DESC
LIMIT 10;"

1	\N	5
1	http://bonprix.ru/index.ru/cinema/art/A00387,3797); ru)&bL	1
1	http://holodilnik.ru/russia/05jul2013&model=0	1
1	http://bonprix.ru/index.ru/cinema/art/0 986 424 233 сезон	1
1	http://tours/Ekategoriya%2F&sr=http://slovareniye	1
1	http://afisha.mail.ru/catalog/314/women.ru/ency=1&page3/?errovat-pinniki	1

$ duckdb --version
v1.3.0 71c5c07cdd

$ duckdb -c "
SELECT 1,
       URL,
       COUNT(*) AS c
FROM 'data.parquet'
GROUP BY 1,
         URL
ORDER BY c DESC
LIMIT 10;"

┌───────┬──────────────────────────────────────────────────────────────────────────┬───────┐
│   1   │                                   URL                                    │   c   │
│ int32 │                                 varchar                                  │ int64 │
├───────┼──────────────────────────────────────────────────────────────────────────┼───────┤
│     1 │ NULL                                                                     │     5 │
│     1 │ http://afisha.mail.ru/catalog/314/women.ru/ency=1&page3/?errovat-pinniki │     1 │
│     1 │ http://bonprix.ru/index.ru/cinema/art/0 986 424 233 сезон                │     1 │
│     1 │ http://bonprix.ru/index.ru/cinema/art/A00387,3797); ru)&bL               │     1 │
│     1 │ http://tours/Ekategoriya%2F&sr=http://slovareniye                        │     1 │
│     1 │ http://holodilnik.ru/russia/05jul2013&model=0                            │     1 │
└───────┴──────────────────────────────────────────────────────────────────────────┴───────┘

philrz avatar Jun 09 '25 20:06 philrz