alamb commented on code in PR #26867:
URL: https://github.com/apache/datafusion/pull/26867#discussion_r4415696447
##########
datafusion/sqllogictest/test_files/datetime/date_part.slt:
##########
@@ -1069,12 +1069,14 @@ FROM (SELECT arrow_cast(column1, 'Timestamp(Nanosecond,
Some("Africa/Monrovia"))
28 28500 28500000 28500000000
NULL NULL NULL NULL
-# timestamps outside the range arrow represents are NULL, like the other parts
+# The second is computed directly from the stored value (i64::MAX % 60 = 7).
The
+# sub-second parts of a timestamp outside the range arrow represents are NULL,
+# like the other parts.
query IIII
SELECT extract(second from ts), extract(millisecond from ts),
extract(microsecond from ts), extract(nanosecond from ts)
FROM (VALUES (arrow_cast(9223372036854775807, 'Timestamp(Second, None)')),
(NULL)) AS t(ts)
----
-NULL NULL NULL NULL
+7 NULL NULL NULL
Review Comment:
Due to
- https://github.com/apache/arrow-rs/pull/11187
`second` is now computed directly from the stored value for timestamps
without a timezone,
`i64::MAX` seconds yields `7` (`i64::MAX % 60`) instead of overflowing to
`NULL`.
The sub-second parts still go through chrono and remain `NULL`. The
nullability reproducer further down now uses `millisecond` so it still produces
a `NULL` from a non-null input.
--
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]