xtern commented on code in PR #2271:
URL: https://github.com/apache/ignite-3/pull/2271#discussion_r1269922100


##########
modules/core/src/main/java/org/apache/ignite/lang/ErrorGroups.java:
##########
@@ -239,6 +197,9 @@ public static class Index {
 
         /** Index not found. */
         public static final int INDEX_NOT_FOUND_ERR = 
INDEX_ERR_GROUP.registerErrorCode((short) 2);
+
+        /** Index already exists. */
+        public static int INDEX_ALREADY_EXISTS_ERR = 
INDEX_ERR_GROUP.registerErrorCode((short) 3);

Review Comment:
   ```suggestion
           public static final int INDEX_ALREADY_EXISTS_ERR = 
INDEX_ERR_GROUP.registerErrorCode((short) 3);
   ```



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDynamicParameterTest.java:
##########
@@ -94,13 +94,18 @@ public void testDynamicParameters() {
         assertQuery("SELECT id FROM person WHERE name LIKE ? ORDER BY id LIMIT 
? OFFSET ?").withParams("I%", 1, 1).returns(2).check();
         assertQuery("SELECT id from person WHERE salary<? and 
id<?").withParams(15, 3).returns(0).check();
 
-        IgniteTestUtils.assertThrowsWithCause(() -> sql("SELECT LAST_DAY(?)", 
Date.valueOf("2022-01-01")),
+        var t = IgniteTestUtils.assertThrowsWithCause(() -> sql("SELECT 
LAST_DAY(?)", Date.valueOf("2022-01-01")),
                 SqlException.class, "Unsupported dynamic parameter defined");
 
+        t.printStackTrace(System.err);
+
         LocalDate date1 = LocalDate.parse("2022-01-01");
         LocalDate date2 = LocalDate.parse("2022-01-31");
 
         assertQuery("SELECT 
LAST_DAY(?)").withParams(date1).returns(date2).check();
+
+        RuntimeException x = assertThrows(RuntimeException.class, () -> 
sql("SELECT CAST(? AS INTEGER)", "lame"));

Review Comment:
   ```suggestion
           IgniteException x = assertThrows(IgniteException.class, () -> 
sql("SELECT CAST(? AS INTEGER)", "lame"));
   ```



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDynamicParameterTest.java:
##########
@@ -94,13 +94,18 @@ public void testDynamicParameters() {
         assertQuery("SELECT id FROM person WHERE name LIKE ? ORDER BY id LIMIT 
? OFFSET ?").withParams("I%", 1, 1).returns(2).check();
         assertQuery("SELECT id from person WHERE salary<? and 
id<?").withParams(15, 3).returns(0).check();
 
-        IgniteTestUtils.assertThrowsWithCause(() -> sql("SELECT LAST_DAY(?)", 
Date.valueOf("2022-01-01")),
+        var t = IgniteTestUtils.assertThrowsWithCause(() -> sql("SELECT 
LAST_DAY(?)", Date.valueOf("2022-01-01")),
                 SqlException.class, "Unsupported dynamic parameter defined");
 
+        t.printStackTrace(System.err);
+
         LocalDate date1 = LocalDate.parse("2022-01-01");
         LocalDate date2 = LocalDate.parse("2022-01-31");
 
         assertQuery("SELECT 
LAST_DAY(?)").withParams(date1).returns(date2).check();
+
+        RuntimeException x = assertThrows(RuntimeException.class, () -> 
sql("SELECT CAST(? AS INTEGER)", "lame"));
+        x.printStackTrace(System.err);

Review Comment:
   I don't quite understand why we need to print this exception if the test 
condition was passed?
   This exception will be printed if it doesn't match the conditions.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to