fuwhu commented on a change in pull request #27232:
[SPARK-30525][SQL]HiveTableScanExec do not need to prune partitions again
URL: https://github.com/apache/spark/pull/27232#discussion_r373541737
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala
##########
@@ -162,22 +162,36 @@ case class HiveTableScanExec(
}
}
- // exposed for tests
- @transient lazy val rawPartitions = {
- val prunedPartitions =
- if (sparkSession.sessionState.conf.metastorePartitionPruning &&
- partitionPruningPred.nonEmpty) {
- // Retrieve the original attributes based on expression ID so that
capitalization matches.
- val normalizedFilters = partitionPruningPred.map(_.transform {
- case a: AttributeReference => originalAttributes(a)
- })
- relation.prunedPartitions.getOrElse(
- sparkSession.sessionState.catalog
- .listPartitionsByFilter(relation.tableMeta.identifier,
normalizedFilters))
+ @transient lazy val prunedPartitions: Seq[HivePartition] = {
+ if (relation.prunedPartitions.nonEmpty &&
Review comment:
@cloud-fan Refined per my understanding, please correct me if i am wrong.
thanks.
----------------------------------------------------------------
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]