WeichenXu123 commented on a change in pull request #25134: [SPARK-28366][CORE] 
Logging in driver when loading single large unsplittable file via sc.textFile
URL: https://github.com/apache/spark/pull/25134#discussion_r302951887
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala
 ##########
 @@ -196,6 +197,24 @@ class HadoopRDD[K, V](
     newInputFormat
   }
 
+  private val UNSPLITTABLE_FILE_SIZE_LOG_THRESHOLD = 1024 * 1024 * 1024
+
+  @transient private lazy val compressionCodecs = new 
CompressionCodecFactory(getJobConf())
+
+  private def checkAndLogUnsplittableLargeFile(split: InputSplit): Unit = {
+    if (split.isInstanceOf[FileSplit]) {
+      val fileSplit = split.asInstanceOf[FileSplit]
+      val path = fileSplit.getPath
+      val codec = compressionCodecs.getCodec(path)
+      if (codec != null && !codec.isInstanceOf[SplittableCompressionCodec]) {
 
 Review comment:
   Here I duplicate `org.apache.hadoop.mapred.TextInputFormat.isSplitable` code 
logic because it is a protected method.

----------------------------------------------------------------
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]

Reply via email to