Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/13137#discussion_r66862256
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala
---
@@ -795,11 +795,15 @@ private[sql] object ParquetFileFormat extends Logging
{
// side, and resemble fake `FileStatus`es there.
val partialFileStatusInfo = filesToTouch.map(f => (f.getPath.toString,
f.getLen))
+ // Set the number of partitions to prevent following schema reads from
generating many tasks
+ // in case of a small number of parquet files.
+ val numParallelism = Math.min(partialFileStatusInfo.size + 1, 10000)
--- End diff --
`Math.min(partialFileStatusInfo.size + 1, parallelism)` is better. I think
this case is different form https://github.com/apache/spark/pull/13444. At
here, we already have a set of files and we apply the same operation to every
file. However, for the issue that https://github.com/apache/spark/pull/13444 is
trying to address, we do not really the amount of work assigned to a task (it
depends on the number of actual files in a dir).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]