HyukjinKwon commented on a change in pull request #25134: [SPARK-28366][CORE]
Logging in driver when loading single large unsplittable file
URL: https://github.com/apache/spark/pull/25134#discussion_r310069282
##########
File path: core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala
##########
@@ -207,6 +208,21 @@ class HadoopRDD[K, V](
} else {
allInputSplits
}
+ if (inputSplits.length == 1 && inputSplits(0).isInstanceOf[FileSplit]) {
+ val fileSplit = inputSplits(0).asInstanceOf[FileSplit]
+ val path = fileSplit.getPath
+ if (fileSplit.getLength > conf.get(IO_WARNING_LARGEFILETHRESHOLD)) {
+ val codecFactory = new CompressionCodecFactory(jobConf)
+ if (Utils.isFileSplittable(path, codecFactory)) {
+ logWarning(s"Loading one large file ${path.toString} with only one
partition, " +
+ s"we can increase partition numbers by the `minPartitions`
argument in method " +
+ "`sc.textFile`")
Review comment:
Is it always `sc.textFile`? Many datasource V1 implementation still uses
`hadoopFile` or `newHadoopFile` often.
----------------------------------------------------------------
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]