cloud-fan 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_r309255363
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/TextBasedFileScan.scala
##########
@@ -33,14 +34,16 @@ abstract class TextBasedFileScan(
readPartitionSchema: StructType,
options: CaseInsensitiveStringMap)
extends FileScan(sparkSession, fileIndex, readDataSchema,
readPartitionSchema) {
- private var codecFactory: CompressionCodecFactory = _
+ @transient private lazy val codecFactory: CompressionCodecFactory = new
CompressionCodecFactory(
+ sparkSession.sessionState.newHadoopConfWithOptions(options.asScala.toMap))
- override def isSplitable(path: Path): Boolean = {
- if (codecFactory == null) {
- codecFactory = new CompressionCodecFactory(
-
sparkSession.sessionState.newHadoopConfWithOptions(options.asScala.toMap))
+ override def isSplitable(path: Path): Boolean = Utils.isFileSplittable(path,
codecFactory)
+
+ override def getFileUnSplittableReason(path: Path): Option[String] = {
+ if (!isSplitable(path)) {
+ Some("the file is compressed by unsplittable compression codec")
+ } else {
+ None
Review comment:
when will we hit this branch?
----------------------------------------------------------------
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]