Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-17179

Consider improving partition pruning in HiveMetastoreCatalog

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.0
    • 2.1.0
    • SQL
    • None

    Description

      Issue:

      • Create an external table with 1000s of partition
      • Running simple query with partition details ends up listing all files for caching in ListingFileCatalog. This would turn out to be very slow in cloud based FS access (e.g S3). Even though, ListingFileCatalog supports
        multi-threading, it would end up unncessarily listing 1000+ files when user is just interested in 1 partition.
      • This adds up additional overhead in HiveMetastoreCatalog as it queries all partitions in convertToLogicalRelation (metastoreRelation.getHiveQlPartitions()). Partition related details
        are not passed in here, so ends up overloading hive metastore.
      • Also even if any partition changes, cache would be dirtied and have to be re-populated. It would be nice to prune the partitions in metastore layer itself, so that few partitions are looked up via FileSystem and only few items are cached.
      "CREATE EXTERNAL TABLE `ca_par_ext`(
        `customer_id` bigint,
        `account_id` bigint)
      PARTITIONED BY (
        `effective_date` date)
      ROW FORMAT SERDE
        'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
      STORED AS INPUTFORMAT
        'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
      OUTPUTFORMAT
        'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
      LOCATION
        's3a://bucket_details/ca_par'"
      
      explain select count(*) from ca_par_ext where effective_date between '2015-12-17' and '2015-12-18';
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rajesh.balamohan Rajesh Balamohan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: