spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] LinhongLiu commented on a change in pull request #26134: [SPARK-29486][SQL] CalendarInterval should have 3 fields: months, days and microseconds
Date Wed, 16 Oct 2019 11:27:29 GMT
LinhongLiu 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_r335418547
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ##########
 @@ -2610,25 +2610,31 @@ object Sequence {
     override val defaultStep: DefaultStep = new DefaultStep(
       (dt.ordering.lteq _).asInstanceOf[LessThanOrEqualFn],
       CalendarIntervalType,
-      new CalendarInterval(0, MICROS_PER_DAY))
+      new CalendarInterval(0, 1, 0))
 
     private val backedSequenceImpl = new IntegralSequenceImpl[T](dt)
-    private val microsPerMonth = 28 * CalendarInterval.MICROS_PER_DAY
+    private val microsPerDay = 24 * CalendarInterval.MICROS_PER_HOUR
+    private val microsPerMonth = 28 * microsPerDay
 
 Review comment:
   the code will use microsPerMonth to estimate the array length first. use the minimum days
in one month can make sure the array long enough. (smaller days means smaller steps in micro
and means longer array length)

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