You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Tim Armstrong (Jira)" <ji...@apache.org> on 2020/12/21 17:47:01 UTC

[jira] [Resolved] (IMPALA-4973) Convert UnionStmt class into to SetOperationStmt

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

Tim Armstrong resolved IMPALA-4973.
-----------------------------------
    Fix Version/s: Impala 4.0
       Resolution: Fixed

Commit ea3f073881783baed17cea2d8bb718038cdfba8a in impala's branch refs/heads/master from Shant Hovsepian
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=ea3f073 ]

IMPALA-9943,IMPALA-4974: INTERSECT/EXCEPT [DISTINCT]

INTERSECT and EXCEPT set operations are implemented as rewrites to
joins. Currently only the DISTINCT qualified operators are implemented,
not ALL qualified. The operator MINUS is supported as an alias for
EXCEPT.

We mimic Oracle and Hive's non-standard implementation which treats all
operators with the same precedence, as opposed to the SQL Standard of
giving INTERSECT higher precedence.

A new class SetOperationStmt was created to encompass the previous
UnionStmt behavior. UnionStmt is preserved as a special case of union
only operands to ensure compatibility with previous union planning
behavior.

Tests:

    Added parser and analyzer tests.
    Ensured no test failures or plan changes for union tests.
    Added TPC-DS queries 14,38,87 to functional and planner tests.
    Added functional tests test_intersect test_except
    New planner testSetOperationStmt

Change-Id: I5be46f824217218146ad48b30767af0fc7edbc0f
Reviewed-on: http://gerrit.cloudera.org:8080/16123
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Aman Sinha <am...@cloudera.com>
Reviewed-by: Tim Armstrong <ta...@cloudera.com>


> Convert UnionStmt class into to SetOperationStmt
> ------------------------------------------------
>
>                 Key: IMPALA-4973
>                 URL: https://issues.apache.org/jira/browse/IMPALA-4973
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Frontend
>    Affects Versions: Impala 2.9.0
>            Reporter: Taras Bobrovytsky
>            Priority: Major
>             Fix For: Impala 4.0
>
>
> SetOperationStmt should be a new class that will be used to represent UNION DISTINCT and UNION ALL operators. A SetOperationStmt should transformed into a QueryStmt during the analysis rewrite phase (StmtRewriter). The resulting query should capture DISTINCT by an appropriate placement of DISTINCT in the Select list.



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