bersprockets commented on code in PR #36442:
URL: https://github.com/apache/spark/pull/36442#discussion_r864952175
##########
sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala:
##########
@@ -2988,4 +2988,16 @@ class ColumnExpressionSuite extends QueryTest with
SharedSparkSession {
checkAnswer(uncDf.filter($"src".ilike("ѐёђѻώề")), Seq("ЀЁЂѺΏỀ").toDF())
// scalastyle:on
}
+
+ test("SPARK-39093: divide period by integral expression") {
+ val df = Seq(((Period.ofDays(10)), 2)).toDF("pd", "num")
+ checkAnswer(df.select($"pd" / ($"num" + 3)),
+ Seq((Period.ofDays(2))).toDF)
+ }
+
+ test("SPARK-39093: divide duration by integral expression") {
+ val df = Seq(((Duration.ofDays(10)), 2)).toDF("dd", "num")
+ checkAnswer(df.select($"dd" / ($"num" + 3)),
+ Seq((Duration.ofDays(2))).toDF)
+ }
Review Comment:
>will be retried in interpreted mode and hence checkAnswer would not be able
to catch this
I just wanted to mention that `CODEGEN_FALLBACK` is set to `false` for
`checkAnswer`, so these two tests do fail without the fix.
https://github.com/apache/spark/blob/834841ef5dab150f249d4171fddb474251beecac/sql/core/src/test/scala/org/apache/spark/sql/test/SharedSparkSession.scala#L70
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]