[
https://issues.apache.org/jira/browse/PHOENIX-6387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17335113#comment-17335113
]
ASF GitHub Bot commented on PHOENIX-6387:
-----------------------------------------
gokceni commented on a change in pull request #1215:
URL: https://github.com/apache/phoenix/pull/1215#discussion_r622701881
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/OnDuplicateKeyIT.java
##########
@@ -498,18 +508,29 @@ public void run() {
exec.shutdownNow();
int finalResult = nThreads * nCommits * nIncrementsPerCommit;
- //assertEquals(finalResult,resultHolder[0]);
- ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " +
tableName + " WHERE counter1 >= 0");
+ boolean isIndexCreated = this.indexDDL != null &&
this.indexDDL.length() > 0;
+
+ ResultSet rs;
+ String selectSql = "SELECT * FROM " + tableName + " WHERE counter1 >=
0";
+ if (isIndexCreated) {
+ rs = conn.createStatement().executeQuery("EXPLAIN " + selectSql);
+ String actualExplainPlan = QueryUtil.getExplainPlan(rs);
+ IndexToolIT.assertExplainPlan(this.indexDDL.contains("local"),
actualExplainPlan,
Review comment:
Local index is just one of the test cases right? Does this pass for all
the indexes?
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/WALAnnotationIT.java
##########
@@ -456,6 +456,42 @@ public void testTenantViewUpsertWithIndex() throws
Exception {
tenantViewHelper(true);
}
+ @Test
+ public void testOnDuplicateUpsertWithIndex() throws Exception {
+ if (this.isImmutable) {
+ return; // on duplicate is not supported for immutable tables
Review comment:
Do we error out when the table is immutable?
Also does conditional update work with single cell format? I recommend
adding a test for it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Conditional updates on tables with indexes
> ------------------------------------------
>
> Key: PHOENIX-6387
> URL: https://issues.apache.org/jira/browse/PHOENIX-6387
> Project: Phoenix
> Issue Type: Improvement
> Affects Versions: 5.0.0, 4.15.0
> Reporter: Kadir OZDEMIR
> Assignee: Tanuj Khurana
> Priority: Major
>
> For a row update done by using the UPSERT VALUES statement, the exact values
> of the columns to be updated are specified within the UPSERT statement.
> Regardless of whether a given row exists or not, after the update, we know
> what the content will be for these columns. However, this is not the case
> when the ON DUPLICATE KEY clause is added the UPSERT VALUES statement. This
> clause makes the update conditional and the end result is determined based on
> the conditions stated within the clause and the current state of the row at
> the time the update is done. Also, this clause makes the UPSERT VALUES
> statement atomic.
> Conditional updates are supported for the tables without indexes currently.
> The current design leverages an HBase atomic operation and cannot be expanded
> to support tables with indexes since the design requires holding (HBase
> level) row locks while doing index table updates over RPCs. This results in
> cluster wide deadlocks. This jira is to redesign conditional updates using
> Phoenix level row locks instead of using HBase level row locks to also
> support tables with indexes by leveraging the design of PHOENIX-6160 which
> simplifies the concurrent mutation handling on tables with indexes.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)