Alex Behm has posted comments on this change.

Change subject: IMPALA-2521: Add clustered hint to insert statements
......................................................................


Patch Set 5:

(7 comments)

http://gerrit.cloudera.org:8080/#/c/4745/5/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java
File fe/src/main/java/org/apache/impala/analysis/InsertStmt.java:

Line 132:   private ArrayList<Expr> kuduKeyExprs_ = Lists.newArrayList();
how about primaryKeyExprs_?


Line 517:    * expressions. Result exprs for key columns of kudu tables are 
stored in kuduKeyExprs_.
Mention that as point 4


Line 601:       // Store exprs for kudu key columns.
Kudu (it's a proper noun)


Line 602:       if (matchFound && table_ instanceof KuduTable) {
You also need to substitute the kuduExprs_ in 
InsertStmt.substituteResultExprs().

You can try something like this (and add a test):

INSERT INTO kudu_table /*+ clustered */
SELECT * FROM (SELECT c1, c2, k1, k2) FROM src_table


Line 604:         for (String kuduKeyColumnName: 
kuduTable.getKuduKeyColumnNames()) {
add helper KuduTable.isPrimaryKeyColumn()


http://gerrit.cloudera.org:8080/#/c/4745/5/fe/src/main/java/org/apache/impala/planner/Planner.java
File fe/src/main/java/org/apache/impala/planner/Planner.java:

Line 499:    * (key columns for kudu tables), so that partitions can be written 
sequentially in the
Kudu tables


http://gerrit.cloudera.org:8080/#/c/4745/5/testdata/workloads/functional-planner/queries/PlannerTest/kudu.test
File testdata/workloads/functional-planner/queries/PlannerTest/kudu.test:

Line 248: insert into table functional_kudu.alltypes /*+ clustered,shuffle */
shuffle/noshuffle don't do anything for Kudu tables, so I don't think this is 
necessary

they might do something in the future


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I412153bd8435d792bd61dea268d7a3b884048f14
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <l...@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com>
Gerrit-Reviewer: Lars Volker <l...@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <mar...@cloudera.com>
Gerrit-HasComments: Yes

Reply via email to