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
Logical error: 'RangeReader read 576 rows, but 8192 expected.' #56640
Comments
cc @davenger |
duplicate of #56202? |
No, the error message and the stacktrace are different. |
|
Reproducer with the analyzer:
|
It's unrelated to the analyzer. The problem is about the execution of PREWHERE clause. Sometimes PrewhereInfo is incorrect. Reproduction with old analyzer: CREATE TABLE data_02051__fuzz_33
(
`key` Date,
`value` UInt16
)
ENGINE = MergeTree
ORDER BY key
SETTINGS
index_granularity_bytes = 0
AS SELECT
number,
repeat(toString(number), 5)
FROM numbers(1000000.);
SET allow_experimental_analyzer = 0;
-- SET optimize_move_to_prewhere = 0;
-- set send_logs_level = 'debug';
SELECT
count(ignore(*))
FROM data_02051__fuzz_33
PREWHERE CAST(ignore() + 1 as UInt8)
GROUP BY
ignore(65535, *),
ignore(255, 256, *) Test for new analyzer: CREATE TABLE data_02051__fuzz_33
(
`key` Date,
`value` UInt16
)
ENGINE = MergeTree
ORDER BY key
SETTINGS
index_granularity_bytes = 0
AS SELECT
number,
repeat(toString(number), 5)
FROM numbers(1000000.);
SET allow_experimental_analyzer = 1;
SELECT
count(ignore(*))
FROM data_02051__fuzz_33
PREWHERE 255
GROUP BY
ignore(65535, *),
ignore(255, 256, *) |
Works on 23.6 https://fiddle.clickhouse.com/1dca2559-27f5-4c0b-a63d-ad58def955ac The difference is that in 23.6 the first reader in the chain of read steps reads 1 column (
but in 23.7 it somehow ends up reading not columns so it returns row count of 2 full granules
|
Looks like this started failing after #52689 Before that we would add a real column to the read step if doesn't read anything.
the last granule size is rounded up 2*8192 while it only has 10000-8192 rows |
Another reproducer (https://s3.amazonaws.com/clickhouse-test-reports/60211/1fa2e0ce3f1779258e450c054d1a13769dc25d6e/ast_fuzzer__ubsan_.html):
Removing prewhere or analyzer fixes it, but it looks more like prewhere is the problem. Aside from the pending fix, why isn't |
Another reproducer:
Without |
https://s3.amazonaws.com/clickhouse-test-reports/56516/857b47de2eaffef8995217f20c8f348c5510fbff/fuzzer_astfuzzertsan/report.html
The text was updated successfully, but these errors were encountered: