Thalweg · API reference ← Main docs

make_millis_to_ts_udf

Function make_millis_to_ts_udf 

Source
pub fn make_millis_to_ts_udf() -> ScalarUDF
Expand description

millis_to_ts(millis) — INT64 milliseconds since epoch → timezone-aware (UTC) microsecond timestamp.

⚠️ Timezone-aware — do NOT use for TIMESTAMP_NTZ destinations. The return type is Timestamp(µs, Some("UTC")); that value — and anything derived from it, e.g. date_trunc('day', …) — is rejected at the write boundary against a timezone-naive Delta column (expected Timestamp(_, None) but got Timestamp(_, Some("UTC"))). For TIMESTAMP_NTZ columns use make_millis_to_ts_ntz_udf (millis_to_ts_ntz) or DataFusion’s built-in to_timestamp_millis, both of which return tz=None. Retained UTC-tagged for backward compatibility with existing timezone-aware SQL. See docs/blueprints/decode-codec-learnings.md §5.