You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Zhichao Zhang (Jira)" <ji...@apache.org> on 2021/01/29 03:37:00 UTC

[jira] [Commented] (SPARK-34283) Combines all adjacent 'Union' operators into a single 'Union' when using 'Dataset.union.distinct'

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

Zhichao  Zhang commented on SPARK-34283:
----------------------------------------

I will handle this issue

> Combines all adjacent 'Union' operators into a single 'Union' when using 'Dataset.union.distinct'
> -------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-34283
>                 URL: https://issues.apache.org/jira/browse/SPARK-34283
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.7, 3.0.0, 3.0.1
>            Reporter: Zhichao  Zhang
>            Priority: Minor
>         Attachments: image-2021-01-29-11-12-44-112.png, image-2021-01-29-11-13-42-055.png, image-2021-01-29-11-14-08-822.png, image-2021-01-29-11-14-42-700.png
>
>
> Problem:
> Currently when using 'Dataset.union.distinct' to union some datasets, Optimizer can't combine all adjacent 'Union' operators into a single 'Union', but it can handle this case when using sql.
> For example:
> !image-2021-01-29-11-12-44-112.png!
> The 'Physical Plan' is shown below:
> !image-2021-01-29-11-13-42-055.png!
> But using sql:
> !image-2021-01-29-11-14-08-822.png!
> The 'Physical Plan' is shown below:
> !image-2021-01-29-11-14-42-700.png!
>  
> Root cause:
> When using 'Dataset.union.distinct', the operator is  'Deduplicate(Columns, Union)', but AstBuilder transform sql 'Union' to operator 'Distinct(Union)', the rule 'CombineUnions' in Optimizer only handle 'Distinct(Union)' operator not Deduplicate(Columns, Union)
>   
>  



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

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