itskals 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_r326437238
##########
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:
What i meant was something like this (each dynamic partition insert is a
separate query):
sql("insert overwrite table t partition(part1=2, part2)" +
" select 2, 2)") //this will create say the 1st partition
sql("insert overwrite table t partition(part1=2, part2)" +
" select 2, 3")//this will create say the 2nd partition
sql("insert overwrite table t partition(part1=2, part2)" +
" select 2, 4)")//this will create say the 3rd partition
sql("insert overwrite table t partition(part1=2, part2)" +
" select 2, 5")//this will create say the 4th partition
Now when do the last sql(trying to create the 4th partition), what is the
behaviour in HIVE and what is expected in spark with your change when we set
SQLConf.DYNAMIC_PARTITION_MAX_PARTITIONS.key -> "3"?
----------------------------------------------------------------
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]