Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/12344#discussion_r60805954
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala
---
@@ -134,8 +134,13 @@ private[sql] object FileSourceStrategy extends
Strategy with Logging {
}
case _ =>
- val maxSplitBytes = files.sqlContext.conf.filesMaxPartitionBytes
+ val defaultMaxSplitBytes =
files.sqlContext.conf.filesMaxPartitionBytes
val openCostInBytes = files.sqlContext.conf.filesOpenCostInBytes
+ val defaultParallelism =
files.sqlContext.sparkContext.defaultParallelism
+ val totalBytes = selectedPartitions.flatMap(_.files.map(_.getLen
+ openCostInBytes)).sum
+ val maxSplitBytes = Math.max(openCostInBytes * 2,
--- End diff --
we should do max and then min, rather than min and then max to guard
against somebody setting a large openCostInBytes value.
also add some documentation explaining the algorithm inline. we should also
explain what the magic number 2 is doing.
---
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]