Skip to main content

Module utils

Module utils 

Source

Functions§

array_length
Get the length (cardinality) of an array expression
array_negative_index_to_positive
convert_nested_transforms
Converts nested transform calls to a different function.
direct_binary_operator_translation
Default translation for a binary operator.
direct_function_translation
Default translation for a function call. It just calls a SQL function with the same name.
direct_unary_operator_translation
Default translation for a unary operator.
function_translation_respecting_ignore_nulls
hamelin_array_index_to_sql_with_negatives
Convert a zero-based Hamelin index to one-based SQL index, handling negative indices. After conversion, out-of-bounds negative indices produce values <= 0. Since Trino’s element_at throws on index 0 and treats negative indices as “from end”, we guard against both by returning NULL for any converted index < 1.
hamelin_string_index_to_sql_with_negatives
Convert a zero-based Hamelin string index to one-based SQL index, handling negative indices For string operations like substr where negative indices need special handling
interval_range_to_timestamp_range
Converts a timestamp range from an interval range by converting each interval to a timestamp by adding it to now().
interval_to_range
Converts an interval expression to a timestamp range from now() + interval to now().
interval_to_timestamp
Converts an interval expression to a timestamp by calculating now() + interval.
string_length
Get the length of a string expression
string_negative_index_to_positive
timestamp_to_range
Converts a timestamp expression to a timestamp range from timestamp to now().
to_sql_concat
Default translation for a binary operator that calls SQL’s concatenation operator.
within_range
A helper that implements WITHIN (range) and also (exp) IN (range) where range is a literal
within_range_expr
A helper that implements WITHIN (range) and also (exp) IN (range) where range is an expression
wrap_timestamp