You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Shohei Okumiya (Jira)" <ji...@apache.org> on 2024/11/02 11:45:00 UTC

[jira] [Commented] (HIVE-28488) Merge adjacent union distinct

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

Shohei Okumiya commented on HIVE-28488:
---------------------------------------

I appreciate you sharing the PDF and writing helpful Java comments. They will be helpful for reviews and future maintenance.

> Merge adjacent union distinct
> -----------------------------
>
>                 Key: HIVE-28488
>                 URL: https://issues.apache.org/jira/browse/HIVE-28488
>             Project: Hive
>          Issue Type: New Feature
>          Components: Logical Optimizer
>            Reporter: Seonggon Namgung
>            Assignee: Seonggon Namgung
>            Priority: Major
>              Labels: hive-4.1.0-must, pull-request-available
>         Attachments: 1.MergeAdjacentUnionDistinct.pdf
>
>
> Current Hive compiles
> "SELECT * FROM TBL1 UNION SELECT * FROM TBL2 UNION SELECT * FROM TBL3"
> to
> {code:java}
> TS - GBY - RS
> TS - GBY - RS - GBY - RS
>            TS - GBY - RS - GBY {code}
> This can be optimized as follows:
> {code:java}
> TS - GBY - RS
> TS - GBY - RS
> TS - GBY - RS - GBY {code}
> Please check out the attached slides for detailed explanation and feel free to ask any questions or share suggestions. Also, it would be glad if one can share about better location of this optimization (e.g. SemanticAnalyzer, Calcite, etc.).



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