impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-3725 Support Kudu UPSERT in Impala
Date Fri, 21 Oct 2016 00:21:36 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-3725 Support Kudu UPSERT in Impala
......................................................................


Patch Set 9:

(9 comments)

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

Line 121:   // If this is an INSERT, will contain all columns of the target table, with NullLiterals
... will contain one Expr for all non-partition columns of the target table ...


Line 124:   // If this is an UPSERT, will contain only mentioned columns and referencedColumns_
is
will contain one Expr per mentioned column


Line 128:   // Position mapping of exprs in resultExprs_ to columns in the target table -
As discussed, please clarify the "if (value == NULL)" part in the BE kudu-table-sink by adding
DCHECKs and comments.


Line 131:   private final List<Integer> referencedColumns_ = Lists.newArrayList();
mentionedUpsertColumns_?

I know they are called differently in ModifyStmts, but those are kind of a misnomer, imo.
"Referenced" columns isn't really accurate because we are not necessarily referencing them
e.g. if the column permutation list is empty.


Line 664:     for (int col = 0; col < columns.size(); col++) {
++col


Line 670:           if (isUpsert_) {
single line


Line 754:     if (isUpsert_) {
easier to add a Preconditions.checkState(isUpsert_ || referencedColumns_.isEmpty());


http://gerrit.cloudera.org:8080/#/c/4047/8/testdata/workloads/functional-query/queries/QueryTest/kudu_crud.test
File testdata/workloads/functional-query/queries/QueryTest/kudu_crud.test:

Line 306: upsert into table tdata (valb, name, id)
> I assume that you're talking about how the query statement is optional for 
Ahh, thanks for clarifying!


http://gerrit.cloudera.org:8080/#/c/4047/9/testdata/workloads/functional-query/queries/QueryTest/kudu_crud.test
File testdata/workloads/functional-query/queries/QueryTest/kudu_crud.test:

Line 307: select false as valb, 'he' as name, id from tdata where id < 2
let's also add an upsert test to see what happens when a PK column is NULL

I suppose we'll get something in ----ERROR?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8df5cea36b642e267f85ff6b163f3dd96b8386e9
Gerrit-PatchSet: 9
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj@cloudera.com>
Gerrit-Reviewer: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message