You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/06/09 11:20:00 UTC

[jira] [Assigned] (SPARK-39429) Convert Inner Join With Aggregate To Semi Join

     [ https://issues.apache.org/jira/browse/SPARK-39429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apache Spark reassigned SPARK-39429:
------------------------------------

    Assignee: Apache Spark

> Convert Inner Join With Aggregate To Semi Join
> ----------------------------------------------
>
>                 Key: SPARK-39429
>                 URL: https://issues.apache.org/jira/browse/SPARK-39429
>             Project: Spark
>          Issue Type: Improvement
>          Components: Optimizer
>    Affects Versions: 3.2.1
>            Reporter: Li Xian
>            Assignee: Apache Spark
>            Priority: Minor
>
> Inner Join with aggregation on one of its child it equivalent to a Semi Join with the aggregation eliminated If the aggregation is just doing grouping and all the grouping columns appears in the join condition.
> For example, Inner Join like below
>  
> {code:java}
> select * from table1 inner join (select key2 from table2 group by key2) subquery on table1.key1 = subquery.key2{code}
> can be transformed to a semi join and eliminate the aggregate in the subquery
>  
>  
> {code:java}
> select * from table1 semi join (select key2 from table2) subquery on table1.key1 = subquery.key2
> {code}
>  
> I think this can be added as a optimize rule to save the unnecessary aggregation in the subquery. 
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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