spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] cloud-fan commented on a change in pull request #26134: [SPARK-29486][SQL] CalendarInterval should have 3 fields: months, days and microseconds
Date Mon, 28 Oct 2019 16:38:52 GMT
cloud-fan commented on a change in pull request #26134: [SPARK-29486][SQL] CalendarInterval
should have 3 fields: months, days and microseconds
URL: https://github.com/apache/spark/pull/26134#discussion_r339669590
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
 ##########
 @@ -61,7 +61,7 @@ object IntervalUtils {
   }
 
   def getDays(interval: CalendarInterval): Long = {
 
 Review comment:
   I played with pgsql a little bit
   ```
   cloud0fan=# SELECT EXTRACT(DAY FROM INTERVAL '1 days 50 hours');
    date_part 
   -----------
            1
   (1 row)
   
   cloud0fan=# SELECT EXTRACT(HOUR FROM INTERVAL '1 days 50 hours');
    date_part 
   -----------
           50
   (1 row)
   
   cloud0fan=# SELECT EXTRACT(HOUR FROM INTERVAL '1 days 50 hours 100 minutes');
    date_part 
   -----------
           51
   (1 row)
   ```
   
   So `getDays` should return the `days` field directly. `getHours` should simply return `microseconds
/ MICROS_PER_HOUR`. @LinhongLiu can you fix it? 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message