Max Gekk created SPARK-57554:
--------------------------------

             Summary: Support cast between TIME and TIMESTAMP_LTZ(p) for p in 
[7, 9]
                 Key: SPARK-57554
                 URL: https://issues.apache.org/jira/browse/SPARK-57554
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 4.3.0
            Reporter: Max Gekk


h2. What

Support {{CAST}} in both directions between {{TIME}} and the nanosecond 
timestamp type
{{TIMESTAMP_LTZ(p)}} ({{TimestampLTZNanos}}, p in 7..9).

h2. Why

Completes the ANSI TIME <-> TIMESTAMP cast matrix for the nanosecond, 
time-zone-aware
timestamp type. Depends on the TIME precision-9 extension and mirrors the 
NTZ-nanos ticket
with session-time-zone handling.

h2. Semantics (ANSI / session time zone)

* {{CAST(time AS TIMESTAMP_LTZ(p))}}: combine the time-of-day with 
{{CURRENT_DATE}} in the
  session time zone, store as an absolute instant at target precision p.
* {{CAST(ts_ltz_nanos AS TIME(q))}}: convert to the session time zone, take the 
time-of-day,
  truncate fractional seconds to q.

h2. Scope

* {{canCast}}/{{canAnsiCast}} + runtime + codegen in {{Cast.scala}}, threading 
session
  {{zoneId}}.
* Reuse the nanos cross-precision floor helpers in {{SparkDateTimeUtils}}; 
preserve full
  nanosecond precision in both directions for p,q in 7..9.

h2. Acceptance criteria

* Both directions correct for all precision combinations of TIME(0..9) and
  TIMESTAMP_LTZ(7..9), across time zones/DST.
* ANSI and non-ANSI modes; tests in {{CastSuiteBase}} and SQL golden files.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to