Skip to main content

Module casts

Module casts 

Source
Expand description

Utilities for casting scalar literals to different data types

This module contains functions for casting ScalarValue literals to different data types, originally extracted from the optimizer’s unwrap_cast module to be shared between logical and physical layers.

Functions§

is_date_narrowing_cast
Returns true when casting a date column from from_type to to_type narrows Date64 (milliseconds) to Date32 (days).
is_supported_type
Returns true if unwrap_cast_in_comparison supports this data type
is_timestamp_precision_narrowing_cast
Returns true when casting a timestamp from from_type to to_type loses timestamp precision.
try_cast_literal_to_type
Convert a literal ScalarValue to target_type, preserving the exact value.