You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/03/04 23:25:00 UTC

[jira] [Commented] (IMPALA-7686) Allow RANGE() clause before HASH() clause for PARTITION BY

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

ASF subversion and git services commented on IMPALA-7686:
---------------------------------------------------------

Commit 158f0b45752de52037a682d5766669c287f2fb72 in impala's branch refs/heads/master from Adam Tamas
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=158f0b4 ]

IMPALA-7686: Allow RANGE() clause before HASH() clause for PARTITION BY

Modified the sql_parser.cup to accept the reversed syntax.

Testing:
-Added extra analyzer tests to cover the case when RANGE() is before HASH()
for Kudu tables.

Change-Id: I914e340e9acfb0f49c7d4f78705dbd9bde0aec8c
Reviewed-on: http://gerrit.cloudera.org:8080/15332
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Allow RANGE() clause before HASH() clause for PARTITION BY
> ----------------------------------------------------------
>
>                 Key: IMPALA-7686
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7686
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Frontend
>    Affects Versions: Impala 2.12.0
>            Reporter: Gabor Kaszab
>            Assignee: Adam Tamas
>            Priority: Minor
>              Labels: newbie
>
> Table creation succeeds this way:
> {code:java}
> CREATE TABLE test3
> (
>   source_system_id BIGINT,
>   id1 BIGINT,
>   id2 BIGINT,
>   name STRING,
>   PRIMARY KEY (source_system_id,id1,id2)
> )
> PARTITION BY 
>     HASH(id1,id2) PARTITIONS 10,
>     RANGE(source_system_id) (
>         PARTITION VALUE = 10000000,
>         PARTITION VALUE = 20000000,
>         PARTITION VALUE = 30000000
>     )
> STORED AS KUDU;
> {code}
> However, it fails with a syntax error if we swap the order of HASH() and RANGE():
> {code:java}
> CREATE TABLE test3
> (
>   source_system_id BIGINT,
>   id1 BIGINT,
>   id2 BIGINT,
>   name STRING,
>   PRIMARY KEY (source_system_id,id1,id2)
> )
> PARTITION BY 
>     RANGE(source_system_id) (
>         PARTITION VALUE = 10000000,
>         PARTITION VALUE = 20000000,
>         PARTITION VALUE = 30000000
>     ),
>     HASH(id1,id2) PARTITIONS 10
> STORED AS KUDU;
> {code}
> I think we shouldn't restrict the order of RANGE() and HASH().
> Check the relevant accepted syntax here:
> https://github.com/apache/impala/blob/6568e6e110e507f5228c1da11e56fd7117ab8a25/fe/src/main/cup/sql-parser.cup#L1416



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

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