Skip to main content

Module type_coercion

Module type_coercion 

Source

Functions§

coerce_for_comparison
Coerce two expressions to their common type for comparison
coerce_for_pyspark_comparison
Coerce two expressions for PySpark-style comparison semantics.
coerce_for_pyspark_eq_null_safe
Coerce left/right for eq_null_safe so string–numeric compares like PySpark (try_to_number on string side). Infers types from literals; assumes String for column (so string–numeric gets coerced).
coerce_to_type
Coerce a column expression to a target type
find_common_type
Determine the common type for two columns based on PySpark’s type precedence rules Returns the tightest (highest precedence) common type that both can be coerced to
infer_type_from_expr
Infer DataType from an expression when it is a literal (for coercion heuristics).

Type Aliases§

CompareOp
Comparison operators of interest for PySpark-style coercion.