MaxGekk commented on PR #56288:
URL: https://github.com/apache/spark/pull/56288#issuecomment-4606906550

   Note on the `cast.sql` golden checks: the positive cases assert the result 
type via `typeof(...)` rather than selecting the cast value directly.
   
   This is intentional. This PR only wires the **string -> nanos** direction. 
The reverse direction (rendering a nanosecond timestamp value back to a string) 
is not implemented yet: `HiveResult`/`TypeApiOps` has no case for 
`TimestampNTZNanosType`/`TimestampLTZNanosType`, so a `SELECT CAST(<string> AS 
TIMESTAMP_LTZ(9))` of a *valid* value would fall through to the unsupported 
result-serialization path. That reverse direction (nanos -> string and the 
nanos-aware `TimestampFormatter`) is tracked separately under SPARK-57162.
   
   So in the golden files:
   - positive cases use `typeof` to confirm the cast type-checks and resolves 
under the preview flag, and
   - negative cases exercise actual evaluation via the parse-error path (ANSI 
throws `CAST_INVALID_INPUT`; non-ANSI returns `NULL`).
   
   Positive value correctness is covered end-to-end in the Scala unit tests 
(`CastSuiteBase`), which compare against the expected `TimestampNanosVal` and 
don't depend on string rendering. Once SPARK-57162 lands, these golden checks 
can be switched to output the values directly.


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