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

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala
 ##########
 @@ -166,14 +166,14 @@ 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(
 
 Review comment:
   @cloud-fan @maropu @advancedxy 
   Since the rawPartitions are called by "prunePartitions(rawPartitions)" in 
doExecute method, it seems prunePartitions will filter out all irrelevant 
partitions using "boundPruningPred". Then why we still need to call 
listpartitionsByFilter here ?
   Could you please help me understand this ? thanks a lot in advance.

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

Reply via email to