ygerzhedovich commented on a change in pull request #710:
URL: https://github.com/apache/ignite-3/pull/710#discussion_r823619969



##########
File path: 
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/jdbc/ItJdbcBatchSelfTest.java
##########
@@ -247,64 +247,41 @@ public void testBatchParseException() throws Exception {
         }
     }
 
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-16489";)
     @Test
     public void testBatchMerge() throws SQLException {
-        final int batchSize = 7;
-
-        for (int idx = 0, i = 0; i < batchSize; ++i, idx += i) {
-            stmt.addBatch("merge into Person (id, firstName, lastName, age) 
values "
-                    + generateValues(idx, i + 1));
-        }
-
-        int[] updCnts = stmt.executeBatch();
-
-        assertEquals(batchSize, updCnts.length, "Invalid update counts size");
-
-        for (int i = 0; i < batchSize; ++i) {
-            assertEquals(i + 1, updCnts[i], "Invalid update count");
-        }
-    }
+        final int batchSize = 5;
 
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-16489";)
-    @Test
-    public void testBatchMergeParseException() throws Exception {
-        final int batchSize = 7;
-
-        final int failedIdx = 5;
-
-        for (int idx = 0, i = 0; i < failedIdx; ++i, idx += i) {
-            stmt.addBatch("merge into Person (id, firstName, lastName, age) 
values "
-                    + generateValues(idx, i + 1));
+        try (Statement statement = conn.createStatement()) {
+            statement.executeUpdate("CREATE TABLE Src(id INT PRIMARY KEY, 
firstName VARCHAR, lastName VARCHAR, age INT)");
         }
 
-        stmt.addBatch("merge into Person (id, firstName, lastName, age) values 
(4444, 'FAIL', 1, 1, 1)");
+        try {
+            for (int idx = 0, i = 0; i < batchSize; ++i, idx += i) {
+                stmt.addBatch("INSERT INTO Person (id, firstName, lastName, 
age) values "
+                        + generateValues(idx, i + 1));
 
-        stmt.addBatch("merge into Person (id, firstName, lastName, age) values 
"
-                + generateValues(100, 7));
+                stmt.addBatch("INSERT INTO Src (id, firstName, lastName, age) 
values "
+                        + generateValues(idx + 1, i + 1));
+            }
 
-        try {
             stmt.executeBatch();
 
-            fail("BatchUpdateException must be thrown");
-        } catch (BatchUpdateException e) {
-            int[] updCnts = e.getUpdateCounts();
+            String sql = "MERGE INTO Person dst USING Src src ON dst.id = 
src.id "

Review comment:
       what about few MERGE statement for batching?




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to