MaxGekk commented on a change in pull request #27807: [SPARK-31076][SQL]
Convert Catalyst's DATE/TIMESTAMP to Java Date/Timestamp via local date-time
URL: https://github.com/apache/spark/pull/27807#discussion_r389120219
##########
File path:
sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out
##########
@@ -848,7 +848,7 @@ SELECT DATE_TRUNC('CENTURY', TO_DATE('0055-08-10 BC',
'yyyy-MM-dd G'))
-- !query schema
struct<date_trunc(CENTURY, CAST(to_date('0055-08-10 BC', 'yyyy-MM-dd G') AS
TIMESTAMP)):timestamp>
-- !query output
--0099-01-01 00:00:00
+0100-01-01 00:00:00
Review comment:
By constructing java.sql.Timestamp via date-time components, we loose
opportunity to print negative years. Internally, the `Date` class performs
normalization, and initializes the era but we don't print the era because we
don't use `'G'` sub-pattern.
If we specify `'G'` in our pattern, the era will printed for our current era
as well. And this will break backward compatibility with previous Spark
versions.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]