Skip to content

Cherry pick #127401 to 26.8: Fix int96 overflow in parquet reader - #128417

Merged
PedroTadim merged 7 commits into
backport/26.8/127401from
cherrypick/26.8/127401
Nov 2, 2026
Merged

PedroTadim merged 7 commits into
backport/26.8/127401from
cherrypick/26.8/127401

Conversation

@robot-ch-test-poll2

Copy link
Copy Markdown
Contributor

Original pull-request #127401

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Before you resolve anything

Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

scanhex12 and others added 6 commits October 22, 2026 12:28
…mestamps

`Int96Converter::convertColumn` threw unconditionally when a timestamp did not
fit into `Int64` nanoseconds, ignoring `date_time_overflow_behavior`. Databricks
writes `0001-01-01` (julian day 1721426) as a default value, so tables with such
columns were unreadable through `DataLakeCatalog` even with
`date_time_overflow_behavior = 'saturate'`.

With `saturate`, values are now clamped to the `DateTime64(9)` range. `throw` and
`ignore` keep the previous behavior.

Related: ClickHouse/support-escalation#8450

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`DateTime64(9)` covers the whole `Int64` range, so in-range values need no
clamping and an overflowing value saturates to the `Int64` minimum or maximum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ower boundary day

`00900_long_parquet_load_2` reads every file in `data_parquet` with default settings, and
`05443_int96_out_of_range.parquet` intentionally throws `VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE` then,
so the test failed with "having exception in stdout" in every `arm_binary` stateless job.

Add `05444_parquet_int96_lower_boundary`: an `INT96` value of `1677-09-21 12:00:00`
(julian day 2333836, time of day 43200000000000 ns). Midnight of that day does not fit into
`Int64` nanoseconds, but the full value -9223329600000000000 does, so it must be read exactly
with both `saturate` and `throw`. Before the `Int128` computation it was saturated to the
`Int64` minimum or rejected.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127401&sha=0c99f04f738aa24ba8d71873d4f0a62bd6ea6511&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
PR: #127401

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…-behavior

Fix int96 overflow in parquet reader
@robot-ch-test-poll2 robot-ch-test-poll2 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels Oct 31, 2026
…ypick/26.8/127401

# Conflicts:
#	tests/queries/0_stateless/00900_long_parquet_load_2.sh
@PedroTadim
PedroTadim merged commit 7e62172 into backport/26.8/127401 Nov 2, 2026
1 check passed
@PedroTadim
PedroTadim deleted the cherrypick/26.8/127401 branch November 2, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants