Type / Encoding Functions
5 functions for hex/binary/base conversions, safe casting, and custom SQL expressions. The source column is always the implicit first input.
| Function | Syntax | Parameters | Notes |
|---|---|---|---|
to_hex | to_hex(column) | None. | |
to_binary | to_binary(column) | None. | |
base_conv | base_conv(column, fromBase, toBase) | fromBase default 10. toBase default 16. | Spark conv(). |
try_cast | try_cast(column, targetType, precision, scale) | targetType — required. precision, scale — used for decimal. | Null-safe cast — returns null on failure instead of raising an error. |
custom_sql | custom_sql(expression) | expression — arbitrary Spark SQL expression string. | Escape hatch for logic not covered by the built-in function catalog. |