[ 
https://issues.apache.org/jira/browse/SPARK-30123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16994175#comment-16994175
 ] 

Hyukjin Kwon commented on SPARK-30123:
--------------------------------------

[~deshanxiao] can you show the plan generated from the actual codes? Also 
please fix the JIRA title to be more specific.

> PartitionPruning should consider more case
> ------------------------------------------
>
>                 Key: SPARK-30123
>                 URL: https://issues.apache.org/jira/browse/SPARK-30123
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: deshanxiao
>            Priority: Major
>
> If left has partitionScan and right has PruningFilter but hasBenefit is 
> false. The right will never be added a SubQuery.
> {code:java}
>             var partScan = getPartitionTableScan(l, left)
>             if (partScan.isDefined && canPruneLeft(joinType) &&
>                 hasPartitionPruningFilter(right)) {
>               val hasBenefit = pruningHasBenefit(l, partScan.get, r, right)
>               newLeft = insertPredicate(l, newLeft, r, right, rightKeys, 
> hasBenefit)
>             } else {
>               partScan = getPartitionTableScan(r, right)
>               if (partScan.isDefined && canPruneRight(joinType) &&
>                   hasPartitionPruningFilter(left) ) {
>                 val hasBenefit = pruningHasBenefit(r, partScan.get, l, left)
>                 newRight = insertPredicate(r, newRight, l, left, leftKeys, 
> hasBenefit)
>               }
>             }
>           case _ =>
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to