Module type_coercion

Module type_coercion 

Source
Expand description

Optimizer rule for type validation and coercion

Structsยง

TypeCoercion
Performs type coercion by determining the schema and performing the expression rewrites.
TypeCoercionRewriter
Rewrite expressions to apply type coercion.

Functionsยง

analyze_internal ๐Ÿ”’
use the external schema to handle the correlated subqueries case
coerce_arguments_for_signature_with_aggregate_udf ๐Ÿ”’
Returns expressions coerced to types compatible with signature, if possible.
coerce_arguments_for_signature_with_scalar_udf ๐Ÿ”’
Returns expressions coerced to types compatible with signature, if possible.
coerce_case_expression ๐Ÿ”’
coerce_frame_bound ๐Ÿ”’
Coerces the given (window frame) bound to target_type.
coerce_output ๐Ÿ”’
Coerce output schema based upon optimizer config.
coerce_scalar ๐Ÿ”’
Casts the given value to target_type. Note that this function only considers Null or Utf8 values.
coerce_scalar_range_aware ๐Ÿ”’
This function coerces value to target_type in a range-aware fashion. If the coercion is successful, we return an Ok value with the result. If the coercion fails because target_type is not wide enough (i.e. we can not coerce to target_type, but we can to a wider type in the same family), we return a Null value of this type to signal this situation. Downstream code uses this signal to treat these values as unbounded.
coerce_union_schema
Get a common schema that is compatible with all inputs of UNION.
coerce_union_schema_with_schema ๐Ÿ”’
coerce_window_frame ๐Ÿ”’
extract_window_frame_target_type ๐Ÿ”’
get_casted_expr_for_bool_op ๐Ÿ”’
get_widest_type_in_family ๐Ÿ”’
This function returns the widest type in the family of given_type. If the given type is already the widest type, it returns None. For example, if given_type is Int8, it returns Int64.
project_with_column_index ๐Ÿ”’
See <https://github.com/apache/datafusion/pull/2108>
transform_schema_to_nonview ๐Ÿ”’
Transform a schema to use non-view types for Utf8View and BinaryView