Repository navigation
Use statistics of a plain Parquet INT64 column read as DateTime - #124863
Conversation
The plain INT64 branch of SchemaConverter::processPrimitiveColumn turned the statistics off for a DateTime target, so a Parquet INT64 column without a logical type (EventTime in ClickBench's hits.parquet) got no row group or page pruning and no top-K row group skipping. The plain INT32 and annotated INTEGER(64) branches already allow it: a bound outside the DateTime range is not used, and IPv4 over a 64-bit integer is still refused. This is the remaining part of ClickHouse#117017; ClickHouse#121033 already added those rules. Co-authored-by: wudidapaopao <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own cold review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-48:20261009-083600 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261009-075700 |
|
Workflow [PR], commit [2134a1c] Summary: ❌
AI ReviewSummaryEnables min/max statistics for unannotated Parquet Missing context / blind spots
Final Verdict✅ Approve — no changes requested. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 15 s compile time in total, 7 of them have a recent master baseline. |
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
CI finish ledger - 158781bEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261009-133010 |
|
Fixing PR for |
|
@groeneai 🕵️
|
Read an optional Int64 column with NULLs as Nullable(DateTime) and as LowCardinality(DateTime), including a top-K read with NULLS FIRST where a row group with NULLs has a maximum below the threshold, and add a file with one row group whose pages cross 0 and UINT32_MAX. The push-down-off lines of the range file now also turn off the page index, which uses the same bounds. Say where the NOT_IMPLEMENTED of the IPv4 read comes from. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks, added in 0f42039. All three paths already behave correctly; the new lines pin them.
With the flip reverted, every new prune count is 0. The test passes 100/100 with random settings. |
…ime-statistics Master factored the plain `INT64` decoder setup into the `set_plain_int64_decoder` lambda, also used for Iceberg `time` read as stored microseconds. The lambda now takes `allow_datetime_and_ipv4`: `true` for the plain `INT64` case (this PR's change), `false` for the Iceberg `time` path (master's behavior). Co-Authored-By: Claude Opus 5.5 <[email protected]>
0b46818
Related: #123564
Related: #117017
Related: #121033
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A Parquet
INT64column without a logical type that is read asDateTime(likeEventTimein ClickBench'shits.parquet) now uses its min/max statistics, soWHEREconditions andORDER BY ... LIMITskip row groups.Description
The remaining part of #123564. This is the same one-line change as #117017 by @ wudidapaopao (credited as co-author). Its bound rules are already on master via #121033, and #117017 itself conflicts with master.
Why it was off. The plain
INT64branch ofSchemaConverter::processPrimitiveColumnpassedallow_datetime_and_ipv4 = false, so a column read asDateTimegot no statistics at all. That was needed while a 64-bit bound outside[0, 4294967295]could reach pruning, because the read saturates such values. Since #121033,IntConverter::convertFieldleaves that side unbounded for a negative or> UINT32_MAXbound, and IPv4 over a 64-bit integer is refused by the order check. The plainINT32and annotatedINTEGER(64)branches already passtrue; this flips the last one. Query results do not change.Measured (debug build, the perf test's 200-row-group file):
WHERE t BETWEEN ...reads 1 row group instead of 200;ORDER BY t [DESC] LIMIT 10skips 189/187 row groups instead of 0. @ snelheidai measured ClickBench q25/q27 at 0.35x time and q24 at 0.64x (their numbers).Validation. New test
05372_parquet_int64_datetime_statistics: pruning and top-K skip counts (fail on the old binary); row groups and pages entirely or partly outside theDateTimerange, and NULLs read asNullable(DateTime)orLowCardinality(DateTime)(including top-K withNULLS FIRST), each against the same query with push-down off; and the IPv4 refusal. Removing the> UINT32_MAXrule or the IPv4 refusal fails the test. #117017's own test also passes. Perf testparquet_int64_datetime_statistics.xml.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/124863]
Version info
26.11.1.289-master(included in26.11and later)