Github user lins05 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16593#discussion_r96348515
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala 
---
    @@ -1343,17 +1343,41 @@ class HiveDDLSuite
           sql("INSERT INTO t SELECT 2, 'b'")
           checkAnswer(spark.table("t"), Row(9, "x") :: Row(2, "b") :: Nil)
     
    -      val e = intercept[AnalysisException] {
    -        Seq(1 -> "a").toDF("i", 
"j").write.format("hive").partitionBy("i").saveAsTable("t2")
    -      }
    -      assert(e.message.contains("A Create Table As Select (CTAS) statement 
is not allowed " +
    -        "to create a partitioned table using Hive"))
    -
           val e2 = intercept[AnalysisException] {
             Seq(1 -> "a").toDF("i", "j").write.format("hive").bucketBy(4, 
"i").saveAsTable("t2")
           }
           assert(e2.message.contains("Creating bucketed Hive serde table is 
not supported yet"))
     
    +      try {
    +        spark.sql("set hive.exec.dynamic.partition.mode=nonstrict")
    --- End diff --
    
    I think we can use `withSQLConf` instead of `try .. finally ..`.
    
    ```scala
    withSQLConf("hive.exec.dynamic.partition.mode" -> "nonstrict") {
    ...
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to