Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13585#discussion_r66741771
  
    --- 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 --
    
    Sorry, @clockfly I am not so sure your mean, this PR is not designed to 
depends on the Optimizer (CNF), can you please give more concrete example if 
there is a bug?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to