LantaoJin commented on a change in pull request #25840: [SPARK-29166][SQL] Add
parameters to limit the number of dynamic partitions for data source table
URL: https://github.com/apache/spark/pull/25840#discussion_r326460911
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala
##########
@@ -654,6 +654,45 @@ class InsertSuite extends DataSourceTest with
SharedSparkSession {
}
}
+ test("SPARK-29166: dynamic partition overwrite with limitation") {
+ withSQLConf(
+ SQLConf.PARTITION_OVERWRITE_MODE.key ->
PartitionOverwriteMode.DYNAMIC.toString) {
+ withTable("t") {
+ sql(
+ """
+ |create table t(i int, part1 int, part2 int) using parquet
+ |partitioned by (part1, part2)
+ """.stripMargin)
+
+ // no restriction
+ sql("insert overwrite table t partition(part1=2, part2)" +
+ " select 2, explode(array(2, 3, 4, 5))")
+ checkAnswer(spark.table("t"),
Review comment:
The limitation parameter won't act on the SQLs above, it doesn't restrict
how many total partitions a table can be inserted whatever dynamic or not. They
are 4 normal queries. It only to limit some unexpected insert like "insert
overwrite table t partition(part1=2, part2) select 2, id" when "id" is a
mistake partition column. I think the behaviour in Hive is same with here, but
I will try this in Hive.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]