singhpk234 commented on code in PR #36442:
URL: https://github.com/apache/spark/pull/36442#discussion_r864555565


##########
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:
   [question] should we add this test with these SQL Confs : 
   (i) WHOLESTAGE_CODEGEN_ENABLED (true) , CODEGEN_FALLBACK (false)
   (ii) WHOLESTAGE_CODEGEN_ENABLED (false) 
   
   As even when the codegen fails by default it will be retried in interpreted 
mode and hence checkAnswer would not be able to catch this. And similar is the 
case with WSCG off as it may pass in Codegen but fail in Interpreted mode, 
hence we might not be able to catch that. Your thoughts ?



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

Reply via email to