These SQL functions are specific to DataFusion, or they are well known and have functionality which is specific to DataFusion. Specifically, the to_timestamp_xx() functions exist due to Arrow's support for multiple timestamp resolutions.
to_timestampto_timestamp() is similar to the standard SQL function. It performs conversions to type Timestamp(Nanoseconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that conversions from other Timestamp and Int64 types can also be performed using CAST(.. AS Timestamp). However, the conversion functionality here is present for consistency with the other to_timestamp_xx() functions.
to_timestamp_millisto_timestamp_millis() does conversions to type Timestamp(Milliseconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that CAST(.. AS Timestamp) converts to Timestamps with Nanosecond resolution; this function is the only way to convert/cast to millisecond resolution.
to_timestamp_microsto_timestamp_micros() does conversions to type Timestamp(Microseconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that CAST(.. AS Timestamp) converts to Timestamps with Nanosecond resolution; this function is the only way to convert/cast to microsecond resolution.
to_timestamp_secondsto_timestamp_seconds() does conversions to type Timestamp(Seconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that CAST(.. AS Timestamp) converts to Timestamps with Nanosecond resolution; this function is the only way to convert/cast to seconds resolution.