Max Gekk created SPARK-57454:
--------------------------------
Summary: Add type coercion and widening rules for
nanosecond-precision timestamp types
Key: SPARK-57454
URL: https://issues.apache.org/jira/browse/SPARK-57454
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 5.0.0
Reporter: Max Gekk
Umbrella: SPARK-56822 (Timestamps with nanosecond precision).
Add implicit type coercion and widening support for the nanosecond-capable
timestamp types TIMESTAMP_NTZ(p) and TIMESTAMP_LTZ(p) (p in 7-9), to reach
parity with the microsecond TimestampType / TimestampNTZType.
Today findWiderDateTimeType in TypeCoercionHelper is microsecond-only and has
no default case, so any pair involving a nanosecond type (including micro+nanos
and nanos(p1)+nanos(p2)) is unhandled and can fail analysis. There are
currently no references to the nanosecond timestamp types anywhere under
sql/catalyst/.../analysis/.
Scope:
- Extend findWiderDateTimeType: nanos<->micro widen to the nanosecond type;
nanos(p1)<->nanos(p2) widen to max precision; nanos<->date.
- Wire TypeCoercion and AnsiTypeCoercion (findTightestCommonType,
findWiderTypeForTwo) and StringPromotionTypeCoercion.
- Tests: UNION ALL, IN, CASE, coalesce, and binary comparisons mixing
micro/nanos.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]