Module utils

Module utils 

Source
Expand description

Utility functions for the interval arithmetic library

Functionsยง

check_support
Indicates whether interval arithmetic is supported for the given expression. Currently, we do not support all PhysicalExprs for interval calculations. We do not support every type of [Operator]s either. Over time, this check will relax as more types of PhysicalExprs and Operators are supported. Currently, CastExpr, NegativeExpr, BinaryExpr, Column and Literal are supported.
convert_duration_bound_to_interval ๐Ÿ”’
Converts a ScalarValue containing a Duration to one containing a time interval, if applicable. Otherwise, returns None.
convert_duration_type_to_interval
Converts an [Interval] of Durations to one of time intervals, if applicable. Otherwise, returns None.
convert_interval_bound_to_duration ๐Ÿ”’
Converts an ScalarValue containing a time interval to one containing a Duration, if applicable. Otherwise, returns None.
convert_interval_type_to_duration
Converts an [Interval] of time intervals to one of Durations, if applicable. Otherwise, returns None.
get_inverse_op
interval_dt_to_duration_ms ๐Ÿ”’
If the day field of the ScalarValue::IntervalDayTime is zero, this function returns the milliseconds part. Otherwise, it returns an error.
interval_mdn_to_duration_ns ๐Ÿ”’
If both the month and day fields of ScalarValue::IntervalMonthDayNano are zero, this function returns the nanoseconds part. Otherwise, it returns an error.
is_datatype_supported
Indicates whether interval arithmetic is supported for the given data type.
is_operator_supported
Indicates whether interval arithmetic is supported for the given operator.