You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/07 14:48:28 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #35258: [SPARK-37969][SQL] HiveFileFormat should check field name

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



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
##########
@@ -2926,16 +2926,18 @@ class HiveDDLSuite
     }
   }
 
-  test("SPARK-33844: Insert overwrite directory should check schema too") {
+  test("SPARK-33844, 37969: Insert overwrite directory should check schema too") {
     withView("v") {
       spark.range(1).createTempView("v")
       withTempPath { path =>
-        val e = intercept[SparkException] {
-          spark.sql(s"INSERT OVERWRITE LOCAL DIRECTORY '${path.getCanonicalPath}' " +
-            s"STORED AS PARQUET SELECT ID, if(1=1, 1, 0), abs(id), '^-' FROM v")
-        }.getCause.getCause.getMessage
-        assert(e.contains(
-          "field ended by ';': expected ';' but got 'IF' at line 2:   optional int32 (IF"))
+        Seq("PARQUET", "ORC").foreach { format =>
+          val e = intercept[SparkException] {

Review comment:
       can we change the related code slightly? I think we shouldn't put the field name check in the big try-catch in `InsertIntoHiveDirCommand.run`.




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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