[
https://issues.apache.org/jira/browse/PHOENIX-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15610459#comment-15610459
]
Hadoop QA commented on PHOENIX-6:
---------------------------------
{color:red}-1 overall{color}. Here are the results of testing the latest
attachment
http://issues.apache.org/jira/secure/attachment/12835456/PHOENIX-6_v2.patch
against master branch at commit 53ca2882722214e15a2f32afd0ca3ed3a4016227.
ATTACHMENT ID: 12835456
{color:green}+1 @author{color}. The patch does not contain any @author
tags.
{color:green}+1 tests included{color}. The patch appears to include 3 new
or modified tests.
{color:green}+1 javac{color}. The applied patch does not increase the
total number of javac compiler warnings.
{color:red}-1 javadoc{color}. The javadoc tool appears to have generated
43 warning messages.
{color:green}+1 release audit{color}. The applied patch does not increase
the total number of release audit warnings.
{color:red}-1 lineLengths{color}. The patch introduces the following lines
longer than 100:
+ String ddl = " create table " + tableName + "(pk varchar primary
key, counter1 bigint, counter2 smallint)";
+ String dml = "UPSERT INTO " + tableName + " VALUES('a',0) ON DUPLICATE
KEY UPDATE counter1 = counter1 + 1";
+ ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " +
tableName + " WHERE counter1 >= 0");
+ rs = conn.createStatement().executeQuery("SELECT * FROM " + tableName
+ " WHERE counter1 >= 0");
+ String ddl = " create table " + tableName + "(k1 varchar, k2 varchar,
counter1 varchar, counter2 varchar, other1 char(3), other2 varchar default 'f',
constraint pk primary key (k1,k2))";
+ String ddl = " create table " + tableName + "(pk varchar primary key,
counter1 varchar, counter2 smallint)";
+ String dml = "UPSERT INTO " + tableName + " VALUES('a','b') ON
DUPLICATE KEY UPDATE counter1 = counter1 || 'b'";
+ ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " +
tableName + " WHERE substr(counter1,1,1) = 'b'");
+ rs = conn.createStatement().executeQuery("SELECT * FROM " + tableName
+ " WHERE substr(counter1,1,1) = 'b'");
+ String ddl = " create table " + tableName + "(pk varchar primary key,
counter1 varchar, counter2 smallint)";
{color:red}-1 core tests{color}. The patch failed these unit tests:
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.index.MutableIndexFailureIT
Test results:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/646//testReport/
Javadoc warnings:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/646//artifact/patchprocess/patchJavadocWarnings.txt
Console output:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/646//console
This message is automatically generated.
> Support ON DUPLICATE KEY construct
> ----------------------------------
>
> Key: PHOENIX-6
> URL: https://issues.apache.org/jira/browse/PHOENIX-6
> Project: Phoenix
> Issue Type: New Feature
> Reporter: James Taylor
> Assignee: James Taylor
> Fix For: 4.9.0
>
> Attachments: PHOENIX-6.patch, PHOENIX-6_4.x-HBase-0.98.patch,
> PHOENIX-6_v2.patch, PHOENIX-6_wip1.patch, PHOENIX-6_wip2.patch,
> PHOENIX-6_wip3.patch, PHOENIX-6_wip4.patch
>
>
> To support inserting a new row only if it doesn't already exist, we should
> support the "on duplicate key" construct for UPSERT. With this construct, the
> UPSERT VALUES statement would run atomically and would thus require a read
> before write which would obviously have a negative impact on performance. For
> an example of similar syntax , see MySQL documentation at
> http://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html
> See this discussion for more detail:
> https://groups.google.com/d/msg/phoenix-hbase-user/Bof-TLrbTGg/68bnc8ZcWe0J.
> A related discussion is on PHOENIX-2909.
> Initially we'd support the following:
> # This would prevent the setting of VAL to 0 if the row already exists:
> {code}
> UPSERT INTO T (PK, VAL) VALUES ('a',0)
> ON DUPLICATE KEY IGNORE;
> {code}
> # This would increment the valueS of COUNTER1 and COUNTER2 if the row already
> exists and otherwise initialize them to 0:
> {code}
> UPSERT INTO T (PK, COUNTER1, COUNTER2) VALUES ('a',0,0)
> ON DUPLICATE KEY UPDATE COUNTER1 = COUNTER1 + 1, COUNTER2 = COUNTER2 + 1;
> {code}
> So the general form is:
> {code}
> UPSERT ... VALUES ... [ ON DUPLICATE KEY [IGNORE | UPDATE
> <column>=<expression>, ...] ]
> {code}
> The following restrictions will apply:
> * The <column> may not be part of the primary key constraint - only KeyValue
> columns will be allowed.
> * This new clause cannot be used with
> ** Immutable tables since the whole point is to atomically update a row in
> place which isn't allowed for immutable tables.
> ** Transactional tables because these use optimistic concurrency as their
> mechanism for consistency and isolation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)