Grant Henke has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/16665 )

Change subject: [java] KUDU-1563. Add support for UPDATE_IGNORE and 
DELETE_IGNORE
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/16665/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java
File java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java:

http://gerrit.cloudera.org:8080/#/c/16665/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduSession.java@408
PS1, Line 408: assertFalse(session.apply(createInsertIgnore(table, 
1)).hasRowError());
             :     List<String> rowStrings = scanTableToStrings(table);
             :     assertEquals(
             :             "INT32 key=1, INT32 column1_i=2, INT32 column2_i=3, 
" +
             :                     "STRING column3_s=a string, BOOL 
column4_b=true",
             :             rowStrings.get(0));
             :
             :     // Test insert ignore does not return a row error.
             :     assertFalse(session.apply(createInsertIgnore(table, 
1)).hasRowError());
             :     rowStrings = scanTableToStrings(table);
             :     assertEquals(
             :             "INT32 key=1, INT32 column1_i=2, INT32 column2_i=3, 
" +
             :                     "STRING column3_s=a string, BOOL 
column4_b=true",
             :             rowStrings.get(0));
             :
             :   }
             :
             :   @Test(timeout = 10000)
             :   public void testUpdateIgnore() throws Exception {
             :     KuduTable table = client.createTable(tableName, basicSchema, 
getBasicCreateTableOptions());
             :     KuduSession session = client.newSession();
             :
             :     // Test update ignore does not return a row error.
             :     assertFalse(session.apply(createUpdateIgnore(table, 1, 1, 
false)).hasRowError());
             :     assertEquals(0, scanTableToStrings(table).size());
             :
             :     assertFalse(session.apply(createInsert(table, 
1)).hasRowError());
             :     assertEquals(1, scanTableToStrings(table).size());
             :
             :     // Test update ignore implements normal update.
             :     assertFalse(session.apply(createUpdateIgnore(table, 1, 2, 
false)).hasRowError());
             :     List<String> rowStrings = scanTableToStrings(table);
             :     assertEquals(1, rowStrings.size());
             :     assertEquals(
             :         "INT32 key=1, INT32 column1_i=2, INT32 column2_i=3, " +
             :             "STRING column3_s=a string, BOOL column4_b=true",
             :         rowStrings.get(0));
             :   }
             :
             :   @Test(timeout = 10000)
             :   public void testDeleteIgnore() throws Exception {
             :     KuduTable table = client.createTable(tableName, basicSchema, 
getBasicCreateTableOptions());
             :     KuduSession session = client.newSession();
             :
             :     // Test delete ignore does not return a row error.
             :     assertFalse(session.apply(createDeleteIgnore(table, 
1)).hasRowError());
             :
             :     assertFalse(session.apply(createInsert(table, 
1)).hasRowError());
             :     assertEquals(1, scanTableToStrings(table).size());
             :
             :     // Test delete ignore implements normal delete.
             :     assertFalse(session.apply(createDeleteIgnore(table, 
1)).hasRowError());
> Don't we need to session.flush() in these tests?
The default is AUTO_FLUSH_SYNC on the Java client: 
https://github.com/apache/kudu/blob/2f5605dfc9f6aed3bfdf5f3e6adad633658b7791/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduSession.java#L193



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6c3cf71b2a487bb18fe195fe20795216aff8e8f9
Gerrit-Change-Number: 16665
Gerrit-PatchSet: 1
Gerrit-Owner: Grant Henke <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Bankim Bhavsar <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <[email protected]>
Gerrit-Comment-Date: Tue, 27 Oct 2020 19:51:33 +0000
Gerrit-HasComments: Yes

Reply via email to