Thalweg · API reference ← Main docs

Module spark_compat

Module spark_compat 

Source
Expand description

Spark-compatible UDF implementations.

Functions that match Apache Spark / Databricks behaviour so existing Spark SQL transformations run unchanged inside the embedded engine.

Functions§

make_millis_to_ts_ntz_udf
millis_to_ts_ntz(millis) — INT64 milliseconds since epoch → timezone-naive microsecond timestamp (Timestamp(µs, None)).
make_millis_to_ts_udf
millis_to_ts(millis) — INT64 milliseconds since epoch → timezone-aware (UTC) microsecond timestamp.
make_sha2_udf
sha2(expr, bit_length) — Databricks/Spark-compatible SHA-2 returning a lowercase HEX STRING (Utf8), NOT raw bytes.
make_to_timestamp_ms_ntz_udf
to_timestamp_ms_ntz(millis) — INT64 milliseconds since epoch → timezone-naive microsecond timestamp (Timestamp(µs, None)), the tz-naive counterpart of make_to_timestamp_ms_udf.
make_to_timestamp_ms_udf
to_timestamp_ms(millis) — timezone-aware (UTC) alias of make_millis_to_ts_udf under a Spark-familiar name.