cxzl25 commented on a change in pull request #29316:
URL: https://github.com/apache/spark/pull/29316#discussion_r486099424
##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala
##########
@@ -847,4 +847,26 @@ class InsertSuite extends QueryTest with TestHiveSingleton
with BeforeAndAfter
}
}
}
+
+ test("SPARK-32508 " +
+ "Disallow empty part col values in partition spec before static partition
writing") {
+ withTable("t1") {
+ spark.sql(
+ """
+ |CREATE TABLE t1 (c1 int)
Review comment:
`InsertIntoHadoopFsRelationCommand`
When writing static partition or dynamic partition, the
`DynamicPartitionDataWriter` will be used, and the partition value of empty
will generate the default value(__HIVE_DEFAULT_PARTITION__) through
`getPartitionPathString`.
When `manageFilesourcePartitions` is not turned on, the partition
information is maintained through the filesystem, so it is not checked whether
the partition value is empty.
`insert ovwriter table a partition(d='') select 1` sql will run successfully.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]