LantaoJin commented on a change in pull request #25840: [SPARK-29166][SQL] Add a parameter to limit the number of dynamic partitions for data source table URL: https://github.com/apache/spark/pull/25840#discussion_r325985789
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SQLHadoopMapReduceCommitProtocol.scala ########## @@ -66,4 +68,18 @@ class SQLHadoopMapReduceCommitProtocol( logInfo(s"Using output committer class ${committer.getClass.getCanonicalName}") committer } + + override def newTaskTempFile( + taskContext: TaskAttemptContext, dir: Option[String], ext: String): String = { + val path = super.newTaskTempFile(taskContext, dir, ext) + if (dynamicPartitionOverwrite) { + val numParts = partitionPaths.size + if (numParts > maxDynamicPartitions) { Review comment: Oh, you are right. `partitionPaths` may be similar to `hive.exec.max.dynamic.partitions.pernode`. And the implementation of total limitation has to add a `var totalPartitions: Int` for checking. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org