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

Yuming Wang commented on SPARK-44654:
-------------------------------------

Another way is convert join to filter if maximum number of rows on one side is 
1: https://github.com/apache/spark/pull/42114

> In subquery cannot perform partition pruning
> --------------------------------------------
>
>                 Key: SPARK-44654
>                 URL: https://issues.apache.org/jira/browse/SPARK-44654
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: 7mming7
>            Priority: Minor
>              Labels: performance
>         Attachments: image-2023-08-03-17-22-53-981.png
>
>
> The following SQL cannot perform partition pruning
> {code:java}
> SELECT * FROM parquet_part WHERE id_type in (SELECT max(id_type) from 
> parquet_part){code}
> As can be seen from the execution plan below, the partition pruning of left 
> cannot be performed after the subquery of in is converted into join
> !image-2023-08-03-17-22-53-981.png!
> The current issue proposes to optimize insubquery. Only when the value of in 
> is greater than a threshold, insubquery will be converted into Join



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to