Github user piaozhexiu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8512#discussion_r41661538
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala ---
    @@ -198,13 +200,21 @@ class HadoopRDD[K, V](
     
       override def getPartitions: Array[Partition] = {
         val jobConf = getJobConf()
    -    // add the credentials here as this can be called before SparkContext 
initialized
    +    // Add the credentials here as this can be called before SparkContext 
initialized
         SparkHadoopUtil.get.addCredentials(jobConf)
    -    val inputFormat = getInputFormat(jobConf)
    -    if (inputFormat.isInstanceOf[Configurable]) {
    -      inputFormat.asInstanceOf[Configurable].setConf(jobConf)
    -    }
    -    val inputSplits = inputFormat.getSplits(jobConf, minPartitions)
    +    val inputPaths = FileInputFormat.getInputPaths(jobConf)
    +    val noWildcard = inputPaths.forall(path => !new 
GlobPattern(path.toString).hasWildcard)
    +    val s3Paths = inputPaths.forall(SparkS3Util.isS3Path(_))
    +    val inputSplits =
    +      if (inputPaths.nonEmpty && noWildcard && s3Paths) {
    +        SparkS3Util.getSplits(jobConf, minPartitions)
    +      } else {
    +        val inputFormat = getInputFormat(jobConf)
    +        if (inputFormat.isInstanceOf[Configurable]) {
    +          inputFormat.asInstanceOf[Configurable].setConf(jobConf)
    +        }
    +        inputFormat.getSplits(jobConf, minPartitions)
    +      }
    --- End diff --
    
    Added "spark.s3.bulk.listing.enabled".


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

Reply via email to