MaxGekk commented on a change in pull request #27494: [SPARK-30760][SQL] Port 
`millisToDays` and `daysToMillis` on Java 8 time API
URL: https://github.com/apache/spark/pull/27494#discussion_r376796005
 
 

 ##########
 File path: 
sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out
 ##########
 @@ -864,15 +864,15 @@ SELECT DATE_TRUNC('DECADE', DATE '0004-12-25')
 -- !query schema
 struct<date_trunc(DECADE, CAST(DATE '0004-12-25' AS TIMESTAMP)):timestamp>
 -- !query output
-0000-01-01 00:07:02
+0000-01-01 00:00:00
 
 
 -- !query
 SELECT DATE_TRUNC('DECADE', TO_DATE('0002-12-31 BC', 'yyyy-MM-dd G'))
 -- !query schema
 struct<date_trunc(DECADE, CAST(to_date('0002-12-31 BC', 'yyyy-MM-dd G') AS 
TIMESTAMP)):timestamp>
 -- !query output
--0010-01-01 00:07:02
+-0010-01-01 00:00:00
 
 Review comment:
   This had been already described in the SQL migration guide. The numbers are 
different because internally we use Proleptic Gregorian calendar in 
`date_trunc` but when we collect data to the driver, we convert internal 
timestamps to `java.sql.Timestamp`. Actually, we switch to Julian calendar for 
old dates here.
   
   By settings 
`localSparkSession.conf.set(SQLConf.DATETIME_JAVA8API_ENABLED.key, true)` in 
`SQLQueryTestSuite.scala`, I just keep the same calendar in all transformations.

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

Reply via email to