cloud-fan commented on issue #25022: [SPARK-24695][SQL] Move `CalendarInterval` 
to org.apache.spark.sql.types package
URL: https://github.com/apache/spark/pull/25022#issuecomment-533573042
 
 
   > But you propose to store days separately, why (besides of the reason that 
parquet does the same)?
   
   Both the Java `Period` classdoc and pgsql doc remind me that 1 day is not 
always equal to 24 hours in the context of interval.
   
   For conceptual interval, you are right that logically it should be a 
combination of all the datetime fields(years, months, days, hours, ...). But 
since 1 year is always 12 months, 1 hour is always 60 minutes, physically we 
only need to store months, days and seconds (at some precision, I'd like to 
pick millisecond).
   
   For concrete interval, it only needs seconds.
   
   So overall, we need 3 fields to store an interval value: months, days and 
seconds.
   
   This is also what pgsql does.

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