You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/21 02:13:40 UTC

[GitHub] [spark] AngersZhuuuu commented on a change in pull request #32975: [SPARK-35820][SQL] Support Cast between different field DayTimeIntervalType

AngersZhuuuu commented on a change in pull request #32975:
URL: https://github.com/apache/spark/pull/32975#discussion_r655032524



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -664,6 +665,29 @@ class CastSuite extends CastSuiteBase {
     }
   }
 
+  test("SPARK-35820: Support cast DayTimeIntervalType in different fields") {
+    val ymPositive = Literal.create(
+      Duration.ofSeconds(12345678L, 123456789),
+      DayTimeIntervalType(DAY, SECOND))
+    val ymNegative = Literal.create(
+      Duration.ofSeconds(-12345678L, -123456789),

Review comment:
       > You can store `Duration.ofSeconds(12345678L, 123456789)` to a val, and call `.negated()`
   
   Done

##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -664,6 +665,29 @@ class CastSuite extends CastSuiteBase {
     }
   }
 
+  test("SPARK-35820: Support cast DayTimeIntervalType in different fields") {
+    val ymPositive = Literal.create(

Review comment:
       > `ymPositive`, I think `ym` shold be replaced. Also fix below values.
   
   DOne




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



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