yaooqinn commented on code in PR #41759:
URL: https://github.com/apache/spark/pull/41759#discussion_r1243508602


##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala:
##########
@@ -3624,6 +3624,14 @@ class DataFrameSuite extends QueryTest
     val df = Seq("0.5944910").toDF("a")
     checkAnswer(df.selectExpr("cast(a as decimal(7,7)) div 100"), Row(0))
   }
+
+  test("SPARK-44206: SparkSession.selectExpr scope Session.active") {
+    val clone = spark.cloneSession()
+    clone.conf.set("spark.sql.legacy.interval.enabled", "true")
+    val df1 = clone.sql("select '2023-01-01'+ INTERVAL 1 YEAR as b").collect()
+    val df2 = clone.sql("select '2023-01-01' as a").selectExpr("a + INTERVAL 1 
YEAR as b").collect()
+    assert(df1 === df2)

Review Comment:
   ```suggestion
       val df1 = clone.sql("select '2023-01-01'+ INTERVAL 1 YEAR as b")
       val df2 = clone.sql("select '2023-01-01' as a").selectExpr("a + INTERVAL 
1 YEAR as b")
      checkAnswer(df2, df1)
   ```



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