Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/13585#discussion_r66714358
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala ---
@@ -65,15 +65,20 @@ private[hive] trait HiveStrategies {
// hive table scan operator to be used for partition pruning.
val partitionKeyIds = AttributeSet(relation.partitionKeys)
val (pruningPredicates, otherPredicates) = predicates.partition {
predicate =>
- !predicate.references.isEmpty &&
+ predicate.references.nonEmpty &&
predicate.references.subsetOf(partitionKeyIds)
}
+ val additionalPartPredicates =
+ PhysicalOperation.partitionPrunningFromDisjunction(
+ otherPredicates.foldLeft[Expression](Literal(true))(And(_,
_)), partitionKeyIds)
pruneFilterProject(
projectList,
otherPredicates,
identity[Seq[Expression]],
- HiveTableScanExec(_, relation, pruningPredicates)(sparkSession))
:: Nil
+ HiveTableScanExec(_,
+ relation,
+ pruningPredicates ++ additionalPartPredicates)(sparkSession))
:: Nil
--- End diff --
For `HiveTableScan`, the predicate here just to minimize the partition
scanning, so what we need to do is to put a more specific partition pruning
predicate.
Sorry if there is something confused.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]