stevomitric opened a new pull request, #57085:
URL: https://github.com/apache/spark/pull/57085

   ### What changes were proposed in this pull request?
   
   Widen the input types of the `unix_seconds` / `unix_millis` / `unix_micros` 
functions to accept `TIMESTAMP_NTZ` and the nanosecond-precision timestamp 
types.
   
   For the nanosecond carrier the child evaluates to a `TimestampNanosVal`, so 
`nullSafeEval` reads its `epochMicros` field and `doGenCode` routes the value 
through a `toMicros` helper.
   
   ### Why are the changes needed?
   
   Previously these functions accepted only `TIMESTAMP_LTZ`, so callers had to 
cast an NTZ or nanosecond timestamp first. This brings them to parity across 
the timestamp families.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. `unix_seconds`/`unix_millis`/`unix_micros` now accept `TIMESTAMP_NTZ` 
and nanosecond
   timestamps directly.
   
   ### How was this patch tested?
   
   Added a `DateExpressionsSuite` case and end-to-end coverage in 
`TimestampNanosFunctionsSuiteBase`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Generated-by: Claude Opus 4.8


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to