spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davies <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-9926] [SPARK-10340] [SQL] Use S3 bulk l...
Date Wed, 02 Sep 2015 22:49:32 GMT
Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8512#discussion_r38594881
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala ---
    @@ -249,6 +256,68 @@ class HadoopTableReader(
       }
     
       /**
    +   * If `spark.sql.hive.parallelFileListing` is true, then pre-calculate input splits
for all the
    +   * partitions together that can be cached in HadoopRDDs.
    +   */
    +  private def populateInputSplitsCache(
    +      hivePartitions: Map[HivePartition, Class[_ <: Deserializer]],
    +      filterOpt: Option[PathFilter]): Map[String, Array[InputSplit]] = {
    +    if (hivePartitions.isEmpty) {
    +      Map[String, Array[InputSplit]]()
    +    } else {
    +      val inputSplitsCache = collection.mutable.Map[String, ArrayBuffer[InputSplit]]()
    +      // Compute input splits for all the partitions together if they have the same input
format.
    +      // This is faster than computing them individually because listing multiple input
dirs can be
    +      // done in parallel using `mapreduce.input.fileinputformat.list-status.num-threads`.
    +      if (sc.conf.parallelFileListing) {
    +        val inputFormatClass = relation.hiveQlTable.getInputFormatClass
    +        val homogeneousInputFormat = hivePartitions.forall {
    +          case (part, _) => part.getInputFormatClass == inputFormatClass
    +        }
    +
    +        if (homogeneousInputFormat) {
    +          val jobConf = new JobConf(hiveExtraConf)
    +          val minPartitions = _minSplitsPerRDD * hivePartitions.size
    +          val combinedPaths = hivePartitions.map { case (part, _) =>
    +            applyFilterIfNeeded(part.getDataLocation, filterOpt)
    +          }.mkString(",")
    +
    +          HadoopTableReader.initializeLocalJobConfFunc(combinedPaths, relation.tableDesc)(jobConf)
    +
    +          val inputSplits =
    +          // If Hive table is stored on S3, we can use S3 bulk listing to speed up listing
    +          // even further. This is particularly faster when listing a large number of
files
    +          // on S3.
    +            if (sc.conf.s3BulkListing) {
    --- End diff --
    
    Should we also test that the paths is coming from S3? Or once we turn this one, it will
fail to load any table from HDFS.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message