Alex Behm has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/9147 )

Change subject: IMPALA-6444: CTAS STORED AS KUDU to support reordering of 
columns
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/9147/5/fe/src/main/java/org/apache/impala/catalog/KuduTable.java
File fe/src/main/java/org/apache/impala/catalog/KuduTable.java:

http://gerrit.cloudera.org:8080/#/c/9147/5/fe/src/main/java/org/apache/impala/catalog/KuduTable.java@391
PS5, Line 391:   public boolean isPrimaryKeyColumn(String name) {
> Yes the issue is reproducible without the fix, when the new CTAS test case
Thanks for checking. To address this bug I think we should make the following 
changes:
1. Expand comment on KuduTable.primaryKeyColumnNames_ to state they are in 
lower case
2. Change KuduTable.createCtasTarget() to the following:

public static KuduTable createCtasTarget(Db db,
      org.apache.hadoop.hive.metastore.api.Table msTbl, List<ColumnDef> 
columnDefs,
      List<ColumnRef> primaryKeyColumnDefs, List<KuduPartitionParam> 
partitionParams) {

A ColumnDef always has a lower case name. The caller in CreateTableAsSelectStmt 
L193 can pass createStmt_.getPrimaryKeyColumnDefs(). The latter needs to be 
made public.

Ultimately, the problem is that we pass in the primary key column names 
directly from the parser. We should pass in the post-analysis ColumnDefs as 
primary keys.


http://gerrit.cloudera.org:8080/#/c/9147/6/fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java:

http://gerrit.cloudera.org:8080/#/c/9147/6/fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java@1678
PS6, Line 1678:     // CTAS into Kudu tables with primary key specified in 
upper case.
IMPALA-6444: CTAS into Kudu table with primary key specified in upper case.


http://gerrit.cloudera.org:8080/#/c/9147/6/testdata/workloads/functional-query/queries/QueryTest/kudu_create.test
File testdata/workloads/functional-query/queries/QueryTest/kudu_create.test:

http://gerrit.cloudera.org:8080/#/c/9147/6/testdata/workloads/functional-query/queries/QueryTest/kudu_create.test@290
PS6, Line 290: ====
revert



--
To view, visit http://gerrit.cloudera.org:8080/9147
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ica1c8ec1544339e9e80733a7a0c78594e0a727d2
Gerrit-Change-Number: 9147
Gerrit-PatchSet: 6
Gerrit-Owner: Pranay Singh
Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com>
Gerrit-Reviewer: Lars Volker <l...@cloudera.com>
Gerrit-Reviewer: Pranay Singh
Gerrit-Comment-Date: Tue, 30 Jan 2018 17:06:30 +0000
Gerrit-HasComments: Yes

Reply via email to