You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/07/12 12:04:40 UTC

[GitHub] [spark] WeichenXu123 commented on a change in pull request #25134: [SPARK-28366][CORE] Logging in driver when loading single large unsplittable file via sc.textFile

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org