cloud-fan commented on a change in pull request #31789:
URL: https://github.com/apache/spark/pull/31789#discussion_r592107402
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala
##########
@@ -2375,4 +2376,16 @@ class ColumnExpressionSuite extends QueryTest with
SharedSparkSession {
assert(e2.getCause.isInstanceOf[RuntimeException])
assert(e2.getCause.getMessage == "hello")
}
+
+ test("SPARK-34677: negate/add/subtract year-month and day-time intervals") {
+ import testImplicits._
+ val df = Seq((Period.ofMonths(10), Duration.ofDays(10),
Period.ofMonths(1), Duration.ofDays(1)))
+ .toDF("year-month-A", "day-time-A", "year-month-B", "day-time-B")
+ val negatedDF = df.select(-$"year-month-A", -$"day-time-A")
+ checkAnswer(negatedDF, Row(Period.ofMonths(-10), Duration.ofDays(-10)))
+ val sumDF = df.select($"year-month-A" + $"year-month-B", $"day-time-A" +
$"day-time-B")
Review comment:
does `sum` function accept the new interval types?
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]