Is your feature request related to a problem or challenge? Please describe what you are trying to do.
This is part of #8982 which wants to support the temporal types (Timestamp* incl. NTZ + timezone, Date32/Date64, Time32*/Time64*).
Currently the temporal cast logic in parquet-variant-compute (type_conversion.rs) hand-rolls conversion/truncation logic that mimics arrow-cast rather than reusing it. For example, several Time*/Timestamp* impls return None when there is leftover sub-second precision instead of truncating the way arrow-cast does (lossy is the default in the cast kernel).
Describe the solution you'd like
Align the logic of casting from/to the temporal types in parquet-variant with arrow-cast by reusing arrow-cast's scalar conversion primitives (the same approach #9688 took for decimals, where rescale_decimal / parse_string_to_decimal_native / single_float_to_decimal were exposed and reused) instead of re-implementing the logic. This keeps a single source of truth for the cast semantics and lets the perfect-shredding fast path (can_use_perfect_shredding_arrow_cast, added in #9862) be widened to cover the truncating temporal pairs it currently excludes.
Describe alternatives you've considered
Additional context
cc @klion26 @AdamGS
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
This is part of #8982 which wants to support the temporal types (
Timestamp*incl. NTZ + timezone,Date32/Date64,Time32*/Time64*).Currently the temporal cast logic in
parquet-variant-compute(type_conversion.rs) hand-rolls conversion/truncation logic that mimicsarrow-castrather than reusing it. For example, severalTime*/Timestamp*impls returnNonewhen there is leftover sub-second precision instead of truncating the wayarrow-castdoes (lossyis the default in the cast kernel).Describe the solution you'd like
Align the logic of casting from/to the temporal types in
parquet-variantwitharrow-castby reusingarrow-cast's scalar conversion primitives (the same approach #9688 took for decimals, whererescale_decimal/parse_string_to_decimal_native/single_float_to_decimalwere exposed and reused) instead of re-implementing the logic. This keeps a single source of truth for the cast semantics and lets the perfect-shredding fast path (can_use_perfect_shredding_arrow_cast, added in #9862) be widened to cover the truncating temporal pairs it currently excludes.Describe alternatives you've considered
Additional context
cc @klion26 @AdamGS