Skip to content

Fix flaky test 02302_defaults_in_columnar_formats on release branches that randomize the Parquet reader - #128946

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-flaky-02302-pin-native-parquet-reader
Nov 3, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-flaky-02302-pin-native-parquet-reader

Conversation

@groeneai

@groeneai groeneai commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #116666

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):

The two queries of the test 02302_defaults_in_columnar_formats that cover the native Parquet reader now pin input_format_parquet_use_native_reader_v3 = 1, so release branches that still randomize this setting no longer run them on the legacy reader.

Description

Failing job: Stateless tests (amd_asan, distributed plan, parallel, 2/2) on the 26.3 backport #128753, https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=128753&sha=7f366daea25e558fcf4dd139269b04998579dd07&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29: Not found field (d) ... While executing ParquetBlockInputFormat ... (THERE_IS_NO_COLUMN), with --input_format_parquet_use_native_reader_v3 0 among the drawn settings. No related open issue found.

The count-only query and the input_format_defaults_for_omitted_fields = 0 query that #116666 added here test the native reader. The file reached 26.3 unchanged (#128501), and the 26.3 runner draws input_format_parquet_use_native_reader_v3 = 0 in about 1 of 6 runs. The legacy reader resolves every requested column before it checks for a count-only read, so with input_format_parquet_allow_missing_columns = 0 the missing d throws.

The fix adds the setting to the SETTINGS of those two queries. The older Parquet query stays unpinned, so 26.3 keeps legacy-reader coverage. On master the setting is obsolete and has no effect: the change only matters on 26.3 and needs v26.3-must-backport (same shape as #107970).

Validation, on the 26.3 CI binary of the failing run:

  • clickhouse local with the reader forced off: the old file fails 10/10 with the CI error, the new file passes 10/10, and with the pin set to 0 it fails again;
  • the 26.3 runner, 60 randomized runs per file: old 12/60 fail (each on a 0 draw), new 60/60 pass, 11 of them on a 0 draw, with system.query_log showing both queries ran with 1.

On master, 50/50 randomized runs pass and the obsolete setting writes nothing to stderr.


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

Version info

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

The count-only query and the input_format_defaults_for_omitted_fields = 0
query added by ClickHouse#116666 test the native Parquet reader. The test was
backported to 26.3 unchanged (ClickHouse#128501), and the 26.3 runner randomizes
input_format_parquet_use_native_reader_v3 to 0 in about 1 of 6 runs. The
legacy ParquetBlockInputFormat resolves every header column in
initializeIfNeeded() before its count-only branch, so with
input_format_parquet_allow_missing_columns = 0 the missing column `d`
throws THERE_IS_NO_COLUMN (seen on the 26.3 backport ClickHouse#128753).

Pin the reader in the SETTINGS of those two queries. A query-level pin
overrides the runner's injected value for that query only, so the older
reader-agnostic Parquet query keeps exercising the legacy reader on 26.3.
On master the setting is obsolete and accepted without effect; the change
matters once backported to 26.3 (same shape as ClickHouse#107970).

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

groeneai commented Nov 3, 2026

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; bounded: 1 full pass + 1 fix round + 1 delta recheck), plus my own cold review (2 nits, no change).

# Sev Finding Verdict Evidence / action
1 💡 Why not a -- Random settings limits: input_format_parquet_use_native_reader_v3=(1, None) line instead of query-level pins? noted, no change The clamp is file-wide on 26.3 (drops legacy-reader coverage of the older Parquet query) and unverifiable on master; the query-level pin wins for those two queries only (checked in system.query_log on 26.3).
2 💡 The input_format_defaults_for_omitted_fields = 0 query might pass on the legacy reader too, so is its pin needed? noted, no change It is the native-reader regression check from #116666; unpinned, it would test a different reader on 26.3.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding. Findings on hunks unchanged by the fix round are auto-dropped.

Session id: cron:clickhouse-review-slot-11:20261103-112700

@groeneai

groeneai commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. 26.3 CI binary of the failing run, clickhouse local --input_format_parquet_use_native_reader_v3=0 on the old file: 10/10 Not found field (d) ... (THERE_IS_NO_COLUMN). The 26.3 runner reproduces it on its own in 12/60 runs, each with a 0 draw.
b Root cause explained? 26.3 randomizes input_format_parquet_use_native_reader_v3 to 0 in about 1 of 6 runs. The legacy reader resolves every requested column before its count-only branch, so the count-only query with input_format_parquet_allow_missing_columns = 0 throws for the missing d. The native reader answers a count-only read from metadata.
c Fix matches root cause? Yes. The two queries are reader-specific by design, so they pin the reader in their own SETTINGS, next to the preconditions they already pin. No blanket tag, no changed expectation, the missing-columns guard is kept.
d Test intent preserved / new tests added? Yes. Reference unchanged; both queries keep testing the native reader on every branch. The older Parquet query stays unpinned and keeps legacy-reader coverage on 26.3. Test-only change, no new test.
e Both directions demonstrated? Yes. Same binary and flag: old file 10/10 fail, new file 10/10 pass, pin set to 0 fails again. 26.3 runner: old 12/60 fail, new 60/60 pass (11 runs on a 0 draw).
f Fix is general across code paths? Both queries added by #116666 are pinned. The older Parquet query is reader-agnostic (passed on 26.3 under both readers); the ORC and Arrow queries are not Parquet. The 26.3 backport touched no other test.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (flaky test setting fix, not a code bug).
h Backward compatible? (maintainer-approved exception only) N/A (test-only). On master the setting is obsolete, accepted, and writes nothing to stderr; 50/50 randomized runs pass.
i Invariants and contracts preserved? N/A (test-only). The test's count-only guard and reference are unchanged.

Session id: cron:clickhouse-impl-slot-41:20261103-110600

@groeneai

groeneai commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

cc @scanhex12, could you review this and add the can be tested label so CI runs? The two queries #116666 added to this test exercise the native Parquet reader, and 26.3 still randomizes input_format_parquet_use_native_reader_v3 to 0 about 1 run in 6, so they now pin it to 1 in their own SETTINGS (obsolete and a no-op on master, needs v26.3-must-backport after merge).

@clickhouse-gh

clickhouse-gh Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7a1a42c]

Summary: ✅


AI Review

Summary

The change pins input_format_parquet_use_native_reader_v3 = 1 for the two native-reader regression queries in 02302_defaults_in_columnar_formats, preventing release-branch randomization from selecting the legacy reader. Existing assertions and the older query's reader coverage are preserved. No actionable findings.

Final Verdict

Status: ✅ Approve

@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 3, 2026
@PedroTadim PedroTadim self-assigned this Nov 3, 2026
@PedroTadim
PedroTadim added this pull request to the merge queue Nov 3, 2026
Merged via the queue into ClickHouse:master with commit 4e51717 Nov 3, 2026
366 of 367 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 3, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 3, 2026
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 3, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 3, 2026
Backport #128946 to 26.10: Fix flaky test `02302_defaults_in_columnar_formats` on release branches that randomize the Parquet reader
clickhouse-gh Bot added a commit that referenced this pull request Nov 3, 2026
Backport #128946 to 26.9: Fix flaky test `02302_defaults_in_columnar_formats` on release branches that randomize the Parquet reader
clickhouse-gh Bot added a commit that referenced this pull request Nov 3, 2026
Backport #128946 to 26.8: Fix flaky test `02302_defaults_in_columnar_formats` on release branches that randomize the Parquet reader
PedroTadim added a commit that referenced this pull request Nov 4, 2026
Backport #128946 to 26.3: Fix flaky test `02302_defaults_in_columnar_formats` on release branches that randomize the Parquet reader
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…formats` on release branches that randomize the Parquet reader
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…formats` on release branches that randomize the Parquet reader
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…formats` on release branches that randomize the Parquet reader
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…_formats` on release branches that randomize the Parquet reader
@clickhouse-gh clickhouse-gh Bot added the comp-parquet-reader-v3 Issues related to the native Parquet reader. label Nov 22, 2026
@clickhouse-gh clickhouse-gh Bot removed the comp-testing Test content only (no production code). label 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-parquet-reader-v3 Issues related to the native Parquet reader. pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.3-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants