cloud-fan commented on a change in pull request #30097:
URL: https://github.com/apache/spark/pull/30097#discussion_r511785672



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/sources/DataSourceAnalysisSuite.scala
##########
@@ -51,21 +51,26 @@ class DataSourceAnalysisSuite extends SparkFunSuite with 
BeforeAndAfterAll {
   }
 
   Seq(true, false).foreach { caseSensitive =>
-    val conf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive)
     def cast(e: Expression, dt: DataType): Expression = {
-      conf.storeAssignmentPolicy match {
+      SQLConf.get.storeAssignmentPolicy match {
         case StoreAssignmentPolicy.ANSI | StoreAssignmentPolicy.STRICT =>
-          AnsiCast(e, dt, Option(conf.sessionLocalTimeZone))
+          AnsiCast(e, dt, Option(SQLConf.get.sessionLocalTimeZone))
         case _ =>
-          Cast(e, dt, Option(conf.sessionLocalTimeZone))
+          Cast(e, dt, Option(SQLConf.get.sessionLocalTimeZone))
       }
     }
-    val rule = DataSourceAnalysis(conf)
+
+    def rule(caseSensitive: Boolean): DataSourceAnalysis.type =
+    {
+      SQLConf.get.setConf(SQLConf.CASE_SENSITIVE, caseSensitive)

Review comment:
       we can set conf at the beginning
   ```
   Seq(true, false).foreach { caseSensitive =>
     SQLConf.get.set...
     ...
     val rule = DataSourceAnalysis
   }
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to