[ 
https://issues.apache.org/jira/browse/SPARK-57814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Max Gekk updated SPARK-57814:
-----------------------------
    Shepherd: Max Gekk

> Support NTZ and nanosecond-precision timestamps in unix_seconds, unix_millis 
> and unix_micros
> --------------------------------------------------------------------------------------------
>
>                 Key: SPARK-57814
>                 URL: https://issues.apache.org/jira/browse/SPARK-57814
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 4.3.0
>            Reporter: Max Gekk
>            Priority: Major
>
> This sub-task is part of the umbrella SPARK-56822 (timestamps with nanosecond 
> precision).
> h2. Problem
> {{TimestampToLongBase}} (datetimeExpressions.scala ~L854-947) types input as 
> {{TimestampType}} only; {{UnixSeconds}} / {{UnixMillis}} / {{UnixMicros}} 
> extend it, so NTZ and all nanosecond timestamp types raise an analysis error. 
> {{unix_nanos}} (SPARK-57527) is a separate nanosecond-only expression.
> h2. Goal
> Accept nanosecond LTZ timestamps (and, for microsecond-parity intent, NTZ) 
> and return the requested unit computed from {{TimestampNanosVal}} (truncating 
> the sub-unit remainder).
> h2. Scope
> Extend {{inputTypes}} to {{AnyTimestampNanoType}}; add a 
> {{TimestampNanosVal}} eval/codegen path converting epoch micros + nanosecond 
> remainder to seconds/millis/micros.
> h2. Acceptance criteria
> * {{unix_micros(ts_nanos)}} equals the value's epoch micros; {{unix_seconds}} 
> / {{unix_millis}} truncate correctly.
> h2. Testing
> {{DateExpressionsSuite}}; nanos golden files.
> h2. Dependencies
> None - independent.



--
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