Fix `date_time_overflow_behavior` being ignored for integer and float casts to DateTime64/Time64 by yariks5s · Pull Request #101512 · ClickHouse/ClickHouse · GitHub
Skip to content

Fix date_time_overflow_behavior being ignored for integer and float casts to DateTime64/Time64#101512

Draft
yariks5s wants to merge 26 commits into
masterfrom
yarik/fix-date_time_overflow_behavior-ignored
Draft

Fix date_time_overflow_behavior being ignored for integer and float casts to DateTime64/Time64#101512
yariks5s wants to merge 26 commits into
masterfrom
yarik/fix-date_time_overflow_behavior-ignored

Conversation

@yariks5s

@yariks5s yariks5s commented Apr 1, 2026

Copy link
Copy Markdown
Member

Fixes date_time_overflow_behavior being silently ignored when casting integer and Float32/Float64 values to DateTime64 and Time64. Previously, overflowing values could skip the VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE exception in throw mode and skip clamping to the target boundary in saturate mode. The fix routes native and wide integer sources (Int8Int256, UInt8UInt256) as well as Float32/Float64 through overflow-aware, scale-aware transforms, and scales Float32 inputs in the Float64 domain so the result is no longer distorted by source-float precision.

Decimal* and BFloat16 sources are out of scope here — their scale-aware overflow handling belongs in DataTypesDecimal.cpp, not in FunctionsConversion.h — and are left for a follow-up.

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fixes date_time_overflow_behavior for integer and Float32/Float64 casts to DateTime64 and Time64: overflowing values now throw VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE in throw mode and clamp to the target boundary in saturate mode; Float32 inputs are scaled in Float64 precision, correcting previously imprecise results.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh

clickhouse-gh Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Apr 1, 2026
@yariks5s yariks5s marked this pull request as draft April 1, 2026 14:44
@alexey-milovidov

Copy link
Copy Markdown
Member

The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix.

@alexey-milovidov

Copy link
Copy Markdown
Member

The failures of "Flaky check" in "functions_bad_arguments" will be fixed by #101994.

@alexey-milovidov

Copy link
Copy Markdown
Member

This was fixed by #105146. Let's update the branch.

Comment thread src/Functions/FunctionsConversion.h Outdated
The previous fix only routed `DataTypeUInt64` through `ToTime64TransformUnsigned`
and `ToDateTime64TransformUnsigned`, so `DataTypeUInt8`/`UInt16`/`UInt32` fell
back to the generic decimal conversion path and bypassed the
`date_time_overflow_behavior` check. This meant cases like
`CAST(3600000::UInt32, 'Time64') SETTINGS date_time_overflow_behavior='throw'`
silently saturated instead of raising `VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE`.

Extend the dispatch to include all narrower unsigned integer sources and
template the transforms on `FromDataType::FieldType`. Guard the overflow
check with a `constexpr` predicate so widths whose entire range fits inside
the target bounds (UInt8/UInt16 to Time64, UInt8/UInt16/UInt32 to DateTime64)
skip it entirely.

Addresses a review comment on
#101512
Comment thread src/Functions/FunctionsConversion.h
Extend the explicit ConvertImpl branches for `DateTime64`/`Time64` to
cover `Int128`/`Int256` and `UInt128`/`UInt256` source types, so that
`date_time_overflow_behavior` is honored when casting wide integers
through `CAST`. Previously these sources fell through to the generic
decimal path and silently ignored the setting.

The transforms now compare and clamp in the source type's domain so
values above `INT64_MAX` are not truncated before the bounds check.
The constexpr skip is reformulated in terms of `sizeof(FromType)` so it
correctly identifies wide ints as requiring a bounds check.

Includes `base/wide_integer_to_string.h` to make the `fmt::formatter`
specialization for `wide::integer` visible to the `Exception` message.
Comment thread src/Functions/FunctionsConversion.h
Comment thread src/Functions/FunctionsConversion.h
alexey-milovidov and others added 5 commits May 25, 2026 13:09
Without this, casts from `Int128`/`Int256`/`UInt128`/`UInt256` to
`DateTime64`/`Time64` were rejected at the wrapper-construction stage with
`CANNOT_CONVERT_TYPE` (code 70), so the routing into the overflow-aware
`ToDateTime64Transform*` / `ToTime64Transform*` paths added in `bce5fc0`
was never reached. The `serverError VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE`
assertions in `04050_time64_cast_uint64_no_wrap.sql` therefore observed
the wrong error code in Fast test.

Allow the wide unsigned/signed integer source families through the
`DataTypeDateTime64`/`DataTypeTime64` wrapper so `date_time_overflow_behavior`
applies uniformly, matching the dispatch in `ConvertImpl`.
The float conversion paths `ToDateTime64TransformFloat` and
`ToTime64TransformFloat` compared the source value against whole-second
bounds (`MAX_DATETIME64_TIMESTAMP` / `MAX_TIME_TIMESTAMP`). However,
`DateTime64` and `Time64` can represent fractional seconds within the
boundary second, so valid values such as `10413791999.1` (a valid
`DateTime64(1)` = `2299-12-31 23:59:59.1`) and `3599999.1` (a valid
`Time64(1)` = `999:59:59.1`) were incorrectly rejected with
`VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE` under `date_time_overflow_behavior =
'throw'`, and clamped down to the whole second under the other modes.

Extend the bounds by the largest fraction representable at the target
scale (`MAX + (1 - 10^-scale)`) so boundary-second fractions are accepted,
and out-of-range values saturate to the maximum representable value rather
than to the truncated whole second. This addresses the review feedback at
`src/Functions/FunctionsConversion.h:605` and `:742`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread src/Functions/FunctionsConversion.h Outdated
alexey-milovidov and others added 3 commits June 4, 2026 08:52
`ToDateTime64TransformFloat`/`Signed`/`Unsigned` computed overflow bounds
from the calendar maximum second (`MAX_DATETIME64_TIMESTAMP`), but at scale
9 that second does not fit in the `Int64` native storage once multiplied by
the scale (`10413791999 * 1e9 > Int64::max`). As a result a value that
passed the bound check could still raise `DECIMAL_OVERFLOW` inside the
conversion even with `date_time_overflow_behavior = 'saturate'`, where it
should clamp instead.

Derive the bounds from the maximum representable native value, capped at
`Int64::max`, so scale 9 saturates to the largest representable value. The
float path now also produces saturated values directly in the native domain
to avoid `Float64` rounding losing the last representable fraction (e.g.
`CAST(1e20 AS DateTime64(6))` now yields `...59.999999` instead of the
imprecise `...59.999998`).

Also initialize `clamped` in the signed transforms (fixes
`cppcoreguidelines-init-variables` in the `arm_tidy` build) and apply the
same native-domain saturation to `ToTime64TransformFloat` for consistency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`03011_definitive_guide_to_cast`: `CAST(1e20 AS DateTime64(6))` now saturates
to the exact maximum fraction (`...59.999999`) instead of the float-imprecise
`...59.999998`, and `CAST(1e20 AS DateTime64(9))` now saturates to the maximum
representable value instead of raising `DECIMAL_OVERFLOW` (the comment is
updated accordingly).

`04050_time64_cast_uint64_no_wrap`: add `throw`/`saturate` coverage for
`DateTime64(9)` with `Float64`, `UInt64` and `Int64` sources, proving `throw`
raises `VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE` (not `DECIMAL_OVERFLOW`) and
`saturate` clamps to the maximum representable value.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexey-milovidov

Copy link
Copy Markdown
Member

Picked up the branch: merged latest master (picks up the fixes you flagged — #101239, #101994, #105146) and addressed the two red CI jobs plus the open DateTime64(9) review blocker.

Build (arm_tidy)variable 'clamped' is not initialized (cppcoreguidelines-init-variables). Initialized clamped in the signed DateTime64/Time64 transforms.

Fast test / 03011_definitive_guide_to_cast and the scale-9 blocker turned out to be the same root cause and are fixed together in f6a9c2d:

  • The overflow bounds were computed from the calendar maximum second (MAX_DATETIME64_TIMESTAMP), but at scale 9 that second does not fit in the Int64 native storage (10413791999 * 1e9 > Int64::max). So a value could pass the bound check and then raise DECIMAL_OVERFLOW inside the conversion even under date_time_overflow_behavior = 'saturate', where it must clamp.
  • The bounds are now derived from the maximum representable native value, capped at Int64::max, in the float and the signed/unsigned integer transforms (the integer paths had the same scale-9 failure mode). saturate clamps to the maximum representable value and throw raises VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE.
  • The float path now produces saturated values directly in the native domain, so CAST(1e20 AS DateTime64(6)) yields the exact 2299-12-31 23:59:59.999999 instead of the float-imprecise ...999998 that was breaking 03011.

I updated the 03011 comment/reference for the DateTime64(9) case (it now saturates instead of throwing DECIMAL_OVERFLOW — matching your note that this behavior was fine to change) and added throw/saturate regression coverage for DateTime64(9) (Float64/UInt64/Int64 sources) to 04050_time64_cast_uint64_no_wrap.

Built on ARM and verified locally: 03011 and 04050 match their references, and a sweep of 13 related date/time cast tests passes. The Decimal*/BFloat16 thread remains as you dismissed it (scale-aware handling belongs in DataTypesDecimal.cpp, out of scope here).

I did not approve, since this is not my own PR.

Comment thread src/Functions/FunctionsConversion.h Outdated
Comment thread src/Functions/FunctionsConversion.h Outdated
@clickhouse-gh

clickhouse-gh Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 38 queries analysed

This PR changes only the numeric-to-DateTime64/Time64 CAST overflow logic (clamping, saturate/throw behavior, and wide-integer support) in the conversion functions, plus the accompanying tests. None of the four flagged ClickBench queries (Q4, Q15, Q28, Q33) cast numbers into DateTime64 or Time64, so the modified code path is never executed by them and cannot plausibly produce these improvements. All four flagged improvements are downgraded to not-sure as run-to-run variance rather than real PR effects. No genuine cross-query performance pattern is present.

clickbench

⚠️ 4 inconclusive

Flagged queries (4 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 4 not_sure 265 229 -13.6% <0.0001 PR only changes numeric->DateTime64/Time64 cast overflow; Q4 runs no such cast. Off-path, run-to-run variance.
⚠️ 15 not_sure 249 200 -19.7% <0.0001 -19.68% but PR touches only DateTime64/Time64 cast paths Q15 never executes. Improvement is noise, not the PR.
⚠️ 28 not_sure 6998 6534 -6.6% <0.0001 Cast-overflow change can't affect this query's execution path; small delta is variance.
⚠️ 33 not_sure 1466 1386 -5.5% <0.0001 Off-path: no numeric->DateTime64/Time64 cast here; -5.46% is run-to-run variance.

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 12b763b9-1cf2-4c8f-bc84-c88d80d819e5
  • MIRAI run: eb228f20-2f4a-4878-9408-ddbba0a8ade0
  • PR check IDs:
    • clickbench_91664_1782314968
    • clickbench_91670_1782314967
    • clickbench_91676_1782314967
    • tpch_adapted_1_official_91683_1782314967
    • tpch_adapted_1_official_91695_1782314967

alexey-milovidov and others added 3 commits June 6, 2026 14:03
Addresses review on the numeric->DateTime64/Time64 cast overflow path.

The `ToDateTime64TransformFloat` / `ToTime64TransformFloat` transforms
decided overflow by narrowing the scaled native bound back to the source
float type (`max_native / scale_multiplier` in `FromType`). For `Float32`
that division rounds to the wrong side of the true bound, so under
`date_time_overflow_behavior = 'throw'` an out-of-range value could pass
the check, and an in-range value could be clamped. Decide overflow instead
by comparing the whole-second part as an integer and the sub-second part in
the `Float64` domain, which is exact enough at every scale and deterministic
across architectures.

The in-range conversion is now also done in the `Float64` domain rather than
through `convertToDecimal`, whose range check runs in the source-float
precision: for a `Float32` value just below the `DateTime64(9)` maximum the
scaled product is indistinguishable from `Int64::max` at `Float32` precision,
so `convertToDecimal` would spuriously raise `DECIMAL_OVERFLOW`. The
`Float64` computation reproduces `convertToDecimal` exactly for `Float64`
sources and is strictly more faithful for `Float32` ones, so such a value is
preserved (`CAST(9223371776::Float32, 'DateTime64(9, 'UTC')')` ->
`2262-04-11 23:42:56`) instead of being rejected.

Adds `Float32` regression coverage to `04050_time64_cast_uint64_no_wrap` and
completes the `01734_datetime64_from_float` reference for the
`DateTime64(9)` saturation cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexey-milovidov

Copy link
Copy Markdown
Member

Updated the branch: merged latest master (232 commits, conflict-free) and finished the two open Float32 review blockers on the float overflow path (d3e60548107).

The ToDateTime64TransformFloat / ToTime64TransformFloat transforms still decided overflow from a bound narrowed back to the source float type (max_native / scale_multiplier in FromType), which for Float32 rounds to the wrong side — letting an out-of-range value pass the throw check or clamping an in-range one. The decision now compares the whole-second part as an integer and the sub-second part in the Float64 domain (exact enough at every scale, deterministic across architectures).

The in-range conversion is also now done in the Float64 domain rather than via convertToDecimal, whose range check runs in the source-float precision: a Float32 value just below the DateTime64(9) maximum is indistinguishable from Int64::max at Float32 precision, so convertToDecimal would spuriously raise DECIMAL_OVERFLOW. Float64 reproduces convertToDecimal exactly for Float64 sources and is strictly more faithful for Float32 ones, so CAST(9223371776::Float32, 'DateTime64(9, ''UTC'')) is now preserved as 2262-04-11 23:42:56.000000000.

Built on this worktree and verified locally: 01734, 03011, 04050 match their references, and a sweep of 78 datetime64/time64 cast tests passes (the only non-passing two are infra-only — user_files permissions and a remote('127.0.0.{1,2}', ...) cluster). Added Float32 regression coverage to 04050_time64_cast_uint64_no_wrap and completed the 01734 reference for the DateTime64(9) saturation cases.

The Decimal*/BFloat16 thread remains as previously dismissed (out of scope here).

Comment thread src/Functions/FunctionsConversion.h
Comment thread src/Functions/FunctionsConversion.h Outdated
alexey-milovidov and others added 3 commits June 9, 2026 12:27
…version path

`toDateTime64(toFloat32(1665519765), 3)` now scales in the `Float64` domain
instead of going through `convertToDecimal` in source-float precision, so the
result is the exact value of the `Float32` input (`1665519744` ->
`2022-10-11 22:22:24.000`) rather than a value distorted by `Float32`-domain
scaling (`2022-10-11 22:21:54.304`).

Fixes the `Fast test` failure:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101512&sha=d3e60548107aff956887b00c070e42a364550fb8&name_0=PR&name_1=Fast%20test

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed scaled-native value

Two fixes in `ToDateTime64TransformFloat` and `ToTime64TransformFloat`:

1. `NaN` left both range-comparison flags false and reached the final
`static_cast<NativeType>`, which is undefined behavior (the pre-existing
`convertToDecimal` path rejected non-finite values). `NaN` is now routed
through the out-of-range path: `throw` raises
`VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE`, `saturate` clamps to a representable
bound. Infinities were already caught by the range checks.

2. The overflow decision compared the binary-rounded fractional part against
the maximum representable fraction, falsely rejecting valid boundary inputs:
`10413791999.999::Float64` for `DateTime64(3)` rounds to a fractional part
slightly above `.999`, yet its scaled product truncates to the valid maximum
native value. The decision is now made on the same truncated scaled-native
value the conversion actually stores, with values at or beyond `2^63`
rejected before the cast.

New tests cover `NaN`/`inf`/`-inf` in both `throw` and `saturate` modes and
the boundary-fraction values for `DateTime64` and `Time64`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alexey-milovidov

Copy link
Copy Markdown
Member

Pushed updates:

  • dff3f8ab592 — updated the 02462_number_to_datetype reference: toDateTime64(toFloat32(...)) now scales in the Float64 domain, so the result is the exact value of the Float32 input rather than a value distorted by source-float-precision scaling. This fixes the sole Fast test failure.
  • 919a29605c3 — addressed the two remaining review findings on the float transforms: NaN is rejected (throw) or clamped (saturate) instead of reaching an undefined static_cast, and the overflow decision is now made on the truncated scaled-native value the conversion actually stores, so valid boundary-fraction inputs like 10413791999.999::Float64 for DateTime64(3) are no longer falsely rejected. Both with tests in 04050_time64_cast_uint64_no_wrap.sql.

Verified locally: 04050_time64_cast_uint64_no_wrap, 02462_number_to_datetype, 01734_datetime64_from_float, 03011_definitive_guide_to_cast, 02900_date_time_check_overflow, 03271_date_to_datetime_saturation, 04092_date_plus_time, 02373_datetime64_monotonicity, 00921_datetime64_compatibility_long all pass against this branch.

The remaining unresolved thread (Decimal*/BFloat16 sources) is deferred to a follow-up as discussed above.

alexey-milovidov and others added 2 commits June 17, 2026 01:34
…ble value

With `date_time_overflow_behavior = 'saturate'`, an out-of-range integer cast to
`DateTime64`/`Time64` clamped to the whole-second maximum and dropped the
sub-second fraction, while the float path clamped to the maximum representable
native value. So `CAST(toUInt64(10413791999), 'DateTime64(9, 'UTC'))` with
`saturate` returned `2262-04-11 23:47:16.000000000` instead of the true type
maximum `2262-04-11 23:47:16.854775807`, and the integer and float saturate
results disagreed at every scale.

The four integer transforms now clamp `saturate` to
`maxRepresentableDateTime64Native` / `maxRepresentableTime64Native` (matching the
float transforms), so saturation reaches the exact target-type boundary at every
scale and the integer and float results agree. The legacy whole-second clamp is
kept for `ignore` only, as before.

Updated `04050_time64_cast_uint64_no_wrap` accordingly: the saturate comparisons
now assert that an out-of-range integer cast equals the corresponding
out-of-range float cast.

Addresses the AI review finding on
#101512

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexey-milovidov

Copy link
Copy Markdown
Member

Pushed 1a136704eec (and merged latest master) addressing the remaining AI-review blocker on the integer saturate clamp.

Integer saturate clamp now reaches the exact target-type boundary. The four integer transforms (ToDateTime64TransformUnsigned/Signed, ToTime64TransformUnsigned/Signed) clamped an out-of-range value to the whole-second maximum, dropping the sub-second fraction, while the float transforms clamped to the maximum representable native value. They now clamp saturate to maxRepresentableDateTime64Native / maxRepresentableTime64Native, so the integer and float results agree at every scale:

  • CAST(toUInt64(10413791999), 'DateTime64(9, 'UTC')) with date_time_overflow_behavior='saturate'2262-04-11 23:47:16.854775807 (was …16.000000000); same for the signed Int64 source.
  • CAST(toUInt64(99999999999), 'DateTime64(3, 'UTC')) saturate → 2299-12-31 23:59:59.999 (was …59.000).
  • CAST(18446744073709551615::UInt64, 'Time64') saturate → 999:59:59.999; negative overflow clamps to -999:59:59.999.

The legacy whole-second clamp is kept for ignore only, as suggested in the review (so the default behavior is unchanged — 01734 and other default-behavior references are untouched).

04050_time64_cast_uint64_no_wrap is updated: the saturate comparisons now assert that an out-of-range integer cast equals the corresponding out-of-range float cast, and the DateTime64(9) / Time64 direct-value references reflect the max representable value. Verified locally — 04050, 01734, 03011, 02462, 02900_date_time_check_overflow, 03271_date_to_datetime_saturation, 02373_datetime64_monotonicity all pass against the rebuilt binary.

The Decimal* / BFloat16 source thread remains deferred to a follow-up as previously discussed (scale-aware overflow handling for those families belongs in DataTypesDecimal.cpp, not in this header); the changelog scope is limited accordingly.

@alexey-milovidov alexey-milovidov changed the title Fix date_time_overflow_behavior being ignored for DateTime… Fix date_time_overflow_behavior being ignored for integer and float casts to DateTime64/Time64 Jun 19, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Addressed the remaining AI-review "Request changes" verdict (the Decimal* / BFloat16 source-family gap) via its own suggested remedy — narrowing the PR title and changelog to the families actually fixed here, rather than expanding scope.

  • Title narrowed from "… for DateTime64/Time64 numeric casts" to "… for integer and float casts to DateTime64/Time64" (the title was also malformed — it ended in a stray whose tail had spilled into the PR body's first line; that is now cleaned up).

  • Changelog entry rewritten to scope the fix to integer and Float32/Float64 sources and to mention both saturate clamping and the Float32 precision change, matching the AI's suggested replacement text:

    Fixes date_time_overflow_behavior for integer and Float32/Float64 casts to DateTime64 and Time64: overflowing values now throw VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE in throw mode and clamp to the target boundary in saturate mode; Float32 inputs are scaled in Float64 precision, correcting previously imprecise results.

Decimal* / BFloat16 sources remain deferred to a follow-up as discussed — their scale-aware overflow handling belongs in DataTypesDecimal.cpp, not in FunctionsConversion.h. The corresponding review thread is resolved since the AI's stated condition (narrow the title/changelog) is now met.

No code change and no re-merge: the head is MERGEABLE, CI is green on f1fa314a, and the branch merged master ~2 days ago (well under a week), so a fresh master merge is not warranted.

@clickhouse-gh

clickhouse-gh Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.30% 85.40% +0.10%
Functions 92.50% 92.60% +0.10%
Branches 77.50% 77.60% +0.10%

Changed lines: Changed C/C++ lines covered by tests: 98/107 (91.59%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 2 line(s) · Uncovered code

Full report · Diff report

…_overflow_behavior-ignored

Resolve the conflict in `src/Functions/FunctionsConversion.h` with the
`toTime64` overflow handling that landed on master via #108028 ("Clamp
`toTime64` to the Time64 range in saturate/ignore overflow modes").

Both changes fix the same bug (overflowing values not being clamped to
the Time64 range in `saturate`/`ignore` modes). This PR's transforms are
a strict superset of #108028: they compare in the source `FromType`
domain so wide integers (`UInt128`/`UInt256`) are not truncated before
the bounds check, clamp `saturate` to `maxRepresentableTime64Native`
(the maximum including its sub-second fraction) while keeping the legacy
whole-second clamp only for `ignore`, and handle `NaN`/`inf` and
`Float32` precision in the float transform. The conflicting hunks were
the `Int8`/`Int16` fall-through (where #108028's clamp is a no-op, since
`Int16` max `32767` is far below `MAX_TIME_TIMESTAMP` `3599999`) and the
float return path, so both resolve to this branch's version. #108028's
unrelated additions on master (interval-conversion fix, Variant/Dynamic
`accurateCastOrNull` column typing) merge in unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date_time_overflow_behavior now applies to the Float32/Float64 branches for DateTime64/Time64, and the integer branches above do the same for Time64, but the generated setting documentation in src/Core/FormatFactorySettings.h still describes only Date/Date32/DateTime/DateTime64 conversions and integer inputs. Users reading the setting docs will miss both the float sources and the Time64 target this PR now relies on.

Please update that setting description in the same PR, e.g. to include integer/float sources and Time/Time64 targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants