You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Max Gekk (Jira)" <ji...@apache.org> on 2026/07/01 14:19:00 UTC
[jira] [Created] (SPARK-57809) Support nanosecond-precision timestamps in collect_list/listagg ordering safety
Max Gekk created SPARK-57809:
--------------------------------
Summary: Support nanosecond-precision timestamps in collect_list/listagg ordering safety
Key: SPARK-57809
URL: https://issues.apache.org/jira/browse/SPARK-57809
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 4.3.0
Reporter: Max Gekk
This sub-task is part of the umbrella SPARK-56822 (timestamps with nanosecond precision).
h2. Problem
{{collect.scala}} {{isCastEqualityPreserving}} (~L750-762) marks {{TimestampNTZType}} as cast-equality-preserving and {{TimestampType}} (LTZ, DST) as unsafe, but has no arm for {{TimestampNTZNanosType}} / {{TimestampLTZNanosType}}, so both fall to {{case _ => false}}. NTZ nanos should be treated like NTZ micro (safe); LTZ nanos like LTZ micro.
h2. Goal
Add nanosecond arms so the ORDER BY-cast optimization applies to NTZ nanos and correctly excludes LTZ nanos, matching the microsecond behavior.
h2. Scope
Extend {{isCastEqualityPreserving}} (and any sibling checks) for {{TimestampNTZNanosType}} and {{TimestampLTZNanosType}}.
h2. Acceptance criteria
* Ordered {{collect_list}} / {{listagg}} over NTZ nanos uses the safe path; LTZ nanos keeps the same DST caveat as micro LTZ.
h2. Testing
{{collect.scala}}-related suites; targeted unit test.
h2. Dependencies
None - independent (builds on the resolved widening/cast infrastructure).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org