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 2019/03/19 03:29:00 UTC

[jira] [Commented] (IMPALA-8283) Creating a Kudu table doesn't take the primary key order specified

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

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

Commit c5918b44b024b3fb476fbae2a1b194e6259befcd in impala's branch refs/heads/master from Todd Lipcon
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=c5918b4 ]

IMPALA-8283. Order of Kudu PRIMARY KEYs can be silently ignored

When creating a Kudu table, we would use the 'PRIMARY KEY (...)' clause
to determine which columns made up the primary key, but the order of
those columns would be ignored. Thus a statement like:

CREATE TABLE (x int, y int, PRIMARY KEY (y, x)) STORED AS KUDU;

would silently create a table with an (x,y) primary key instead of a
(y,x) key. This can have substantial performance implications.

This fixes the frontend to correctly throw an error in this case.

This might be incompatible if someone was previously relying on the bug,
but I think it's worth fixing because it was clearly doing the wrong
thing.

Change-Id: I0499cee7c532db19cddac3906198d965b27ea604
Reviewed-on: http://gerrit.cloudera.org:8080/12694
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Todd Lipcon <to...@apache.org>


> Creating a Kudu table doesn't take the primary key order specified
> ------------------------------------------------------------------
>
>                 Key: IMPALA-8283
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8283
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Brian Hausmann
>            Assignee: Todd Lipcon
>            Priority: Major
>              Labels: impala, impala-kudu, kudu
>             Fix For: Impala 3.3.0
>
>
> *Example1:*
> When trying to create a new Kudu table from an existing Kudu table with a different primary key order, Impala takes the primary key structure from the existing Kudu Table instead of the new key order specified in the create table statement.
> existingtable: (a string, b string, c string, d boolean) primary key (a, b, c) partition by hash (a) stored as kudu
>  
> {code:java}
> create table newtable primary key (b, a, c) partition by hash (a) stored as kudu as Select * from table1
> {code}
>  
> Result: newtable is created with the same primary key order (a, b, c) as table1 instead of specified (b, a, c) order
>  
> The workaround for this was to create an empty table with the correct key structure and field order and then insert the data into the table
>  
> *Example 2:*
> Issue also exists when schema has a different order than the primary key specified.
> {code:java}
> Create table newtable2 (a string, b string, c string, d boolean) primary key (b, a , c) partition by hash(a) stored as kudu{code}
> Result: newtable2 has PK order of (a,b,c) instead of specified (b, a, c) and no error is given



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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