Skip to content

Print only the profile event totals in 05141_parquet_time_stats_pruning and 05361_parquet_geometry_logical_type_interop - #130688

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-05141-05361-profile-events-totals
Nov 11, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-05141-05361-profile-events-totals

Conversation

@groeneai

@groeneai groeneai commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #125738

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Description

Since 2026-11-10, 05141_parquet_time_stats_pruning fails with a row group counter printed on two lines whose values add up to the expected one, e.g. ParquetPrunedRowGroups: 1 and ParquetPrunedRowGroups: 2 instead of ParquetPrunedRowGroups: 3 (master, Stateless tests (amd_tsan, parallel), and 6 PR runs). 05361_parquet_geometry_logical_type_interop failed the same way, 8 + 1 instead of 9 (master, Stateless tests (amd_tsan, s3 storage, parallel, 2/3)).

Since #125738, a single local Parquet file is read by several sources, and each one adds its own share of ParquetReadRowGroups / ParquetPrunedRowGroups when it starts. clickhouse-local sends a ProfileEvents packet with the deltas every interactive_delay (100 ms), and at the default --profile-events-delay-ms=0 the client prints every packet separately. When the sources start on both sides of a packet (a sanitizer build, a loaded runner), one counter is printed as partial lines. The totals are correct.

Both tests now pass --profile-events-delay-ms=-1, which prints each counter once with its total, as 02310_profile_events_insert does. The references are unchanged, and the tests still check the same numbers on the split read path.

Validation with the CI amd_binary builds, forcing a packet every 1 ms (--interactive_delay=1000): the 05141 query prints the counter on several lines in 0/50 runs before #125738, 17/50 at its merge commit, 32/50 at this PR's base, and 0/50 with -1. Under that cadence 05141 fails 5/20 and 05361 20/20 without the change, both pass 50/50 with it, and both pass 50/50 at the default cadence.

Reverting #125738 would also stop these failures; I changed the tests instead because the counters it produces are correct.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/130688]

Version info

  • Merged into: 26.11.1.1986-master (included in 26.11 and later)

`05141_parquet_time_stats_pruning` and
`05361_parquet_geometry_logical_type_interop` grep row group counters from
`clickhouse-local --print-profile-events` and expect one line per counter
with its total.

Since ClickHouse#125738 a single local Parquet file is split into buckets read by
separate sources, and each bucket's `ReadManager::init` adds its own share
of `ParquetReadRowGroups` / `ParquetPrunedRowGroups`. `LocalConnection`
sends a ProfileEvents packet with the deltas every `interactive_delay`
(100 ms), and with the default `--profile-events-delay-ms=0` the client
prints every packet separately. When the sources initialize on both sides
of a packet (sanitizer builds, loaded runners), a counter is printed as
partial lines, e.g. `ParquetPrunedRowGroups: 1` and `: 2` instead of `: 3`.
The totals are correct.

`--profile-events-delay-ms=-1` makes the client sum all packets and print
each counter once at the end, which is what the tests assert. The
references are unchanged.

Forcing a packet every 1 ms (`--interactive_delay=1000`) with the CI
amd_binary builds: the 05141 query splits the counter in 0/50 runs before
ClickHouse#125738, 17/50 at its merge commit, 32/50 at the base of this change and
0/50 with `-1`; 05141 fails 5/20 and 05361 20/20 without the change and
both pass 50/50 with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings). The reviewer's own cold review found no blocker or major issue either, so there is nothing to adjudicate.

Session id: cron:clickhouse-review-slot-9:20261111-042800

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. --interactive_delay=1000 (a packet every 1 ms) on the CI amd_binary of the base splits the 05141 counter in 32/50 standalone runs; the tests fail 5/20 (05141) and 20/20 (05361) under it.
b Root cause explained? Since #125738 every bucket source of a split Parquet file adds its own share of ParquetReadRowGroups / ParquetPrunedRowGroups (ReadManager.cpp:109-110); clickhouse-local sends the deltas every interactive_delay, and at --profile-events-delay-ms=0 each packet is printed separately (ClientBase.cpp:2376-2394), so increments that straddle a packet give partial lines.
c Fix matches root cause? Yes. The tests assert totals, and --profile-events-delay-ms=-1 prints totals. No bound widened, no randomization removed, the split read path still runs.
d Test intent preserved / new tests added? Yes. Every assertion and both references are unchanged; a wrong number of read or pruned row groups still fails. Test-only change.
e Both directions demonstrated? Yes. Forced cadence: 05141 5/20 FAIL -> 50/50 OK, 05361 20/20 FAIL -> 50/50 OK. Standalone: 0/50 split before #125738, 17/50 at its merge, 32/50 at the base, 0/50 with -1. Default cadence: both 50/50.
f Fix is general across code paths? Yes. Of all --print-profile-events tests that read Parquet, only these two expect a per-line value >= 2 from a file with several row groups; the others expect 1, read 1 row group, sum with awk, or already use -1.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes. All six 05141 predicates (Time64(6) from INT64, Time64(3) from INT32) and all four 05361 counter checks run in every validation above.
h Backward compatible? (maintainer-approved exception only) Yes. Test-only change.
i Invariants and contracts preserved? Yes. No engine code changed; the totals match the unchanged references.

Session id: cron:clickhouse-impl-slot-5:20261111-035700

@clickhouse-gh

clickhouse-gh Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [db11d1a]

Summary: ✅


AI Review

Summary

PR #130688 adds --profile-events-delay-ms=-1 to the counter-reporting invocations in 05141_parquet_time_stats_pruning and 05361_parquet_geometry_logical_type_interop. This makes their assertions compare accumulated row-group totals regardless of packet timing. Queries, expected values, and pruning coverage remain unchanged. No actionable findings.

Missing context / blind spots
  • ⚠️ The functional scripts were not rerun locally because this checkout has no available ClickHouse binary. The green PR CI's Fast test skips both tests via no-fasttest; runtime evidence is the author's documented repeated runs, including forced 1 ms packet intervals. Independent execution of both scripts with that interval would close this verification gap.
Final Verdict

Status: ✅ Approve. No required changes.

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 11, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 11, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 11, 2026
Merged via the queue into ClickHouse:master with commit 183e9ae Nov 11, 2026
369 of 370 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 11, 2026
@clickhouse-gh clickhouse-gh Bot added comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants