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_r341087581
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
 ##########
 @@ -664,16 +664,16 @@ abstract class CastSuiteBase extends SparkFunSuite with 
ExpressionEvalHelper {
     import org.apache.spark.unsafe.types.CalendarInterval
 
     checkEvaluation(Cast(Literal(""), CalendarIntervalType), null)
-    checkEvaluation(Cast(Literal("interval -3 month 7 hours"), 
CalendarIntervalType),
-      new CalendarInterval(-3, 7 * CalendarInterval.MICROS_PER_HOUR))
+    checkEvaluation(Cast(Literal("interval -3 month 1 day 7 hours"), 
CalendarIntervalType),
+      new CalendarInterval(-3, 1, 7 * CalendarInterval.MICROS_PER_HOUR))
     checkEvaluation(Cast(Literal.create(
-      new CalendarInterval(15, -3 * CalendarInterval.MICROS_PER_DAY), 
CalendarIntervalType),
+      new CalendarInterval(15, 9, -3 * CalendarInterval.MICROS_PER_HOUR), 
CalendarIntervalType),
       StringType),
-      "interval 1 years 3 months -3 days")
+      "interval 1 years 3 months 1 weeks 2 days -3 hours")
 
 Review comment:
   @MaxGekk @dongjoon-hyun this is another instance we can think of: I feel `9 
days` is more readable than `1 week 2 days`.

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