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/10/24 15:18:09 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #25919: [WIP][SPARK-15616][SQL] Hive table supports partition pruning in JoinSelection

cloud-fan commented on a change in pull request #25919: [WIP][SPARK-15616][SQL] Hive table supports partition pruning in JoinSelection
URL: https://github.com/apache/spark/pull/25919#discussion_r338635868
 
 

 ##########
 File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala
 ##########
 @@ -166,14 +166,20 @@ case class HiveTableScanExec(
   @transient lazy val rawPartitions = {
     val prunedPartitions =
       if (sparkSession.sessionState.conf.metastorePartitionPruning &&
-          partitionPruningPred.size > 0) {
+        partitionPruningPred.nonEmpty) {
         // Retrieve the original attributes based on expression ID so that capitalization matches.
         val normalizedFilters = partitionPruningPred.map(_.transform {
           case a: AttributeReference => originalAttributes(a)
         })
-        sparkSession.sessionState.catalog.listPartitionsByFilter(
-          relation.tableMeta.identifier,
-          normalizedFilters)
+        val isFiltersEqual = normalizedFilters.zip(relation.normalizedFilters)
+          .forall { case (e1, e2) => e1.semanticEquals(e2) }
+        if (isFiltersEqual) {
 
 Review comment:
   What are we doing here?

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