You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ygerzhedovich (via GitHub)" <gi...@apache.org> on 2023/09/22 12:54:58 UTC

[GitHub] [ignite-3] ygerzhedovich opened a new pull request, #2618: IGNITE-20388: Migrate ClusterPerClassIntegrationTest to run queries via public api

ygerzhedovich opened a new pull request, #2618:
URL: https://github.com/apache/ignite-3/pull/2618

   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2618: IGNITE-20388: Migrate ClusterPerClassIntegrationTest to run queries via public api

Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2618:
URL: https://github.com/apache/ignite-3/pull/2618#discussion_r1338526736


##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java:
##########
@@ -200,4 +208,40 @@ public static Object generateValueByType(int base, ColumnType type) {
                 throw new IllegalArgumentException("unsupported type " + type);
         }
     }
+
+    /**
+     * Run SQL in given Ignite instance with given transaction and parameters.
+     *
+     * @param ignite Ignite instance to run a query.
+     * @param tx Transaction to run a given query. Can be {@code null} to run within implicit transaction.
+     * @param sql Query to be run.
+     * @param args Dynamic parameters for a given query.
+     * @return List of lists , where outer list represents a rows, internal lists represents a columns.
+     */
+    public static List<List<Object>> sql(Ignite ignite, @Nullable Transaction tx, String sql, Object... args) {
+        try (Session session = ignite.sql().createSession()) {
+            ResultSet<SqlRow> rs = session.execute(tx, sql, args);
+
+            return getAllResultSet(rs);
+        }
+    }

Review Comment:
   agree, thanks



##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java:
##########
@@ -200,4 +208,40 @@ public static Object generateValueByType(int base, ColumnType type) {
                 throw new IllegalArgumentException("unsupported type " + type);
         }
     }
+
+    /**
+     * Run SQL in given Ignite instance with given transaction and parameters.
+     *
+     * @param ignite Ignite instance to run a query.
+     * @param tx Transaction to run a given query. Can be {@code null} to run within implicit transaction.
+     * @param sql Query to be run.
+     * @param args Dynamic parameters for a given query.
+     * @return List of lists , where outer list represents a rows, internal lists represents a columns.

Review Comment:
   done



-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] korlov42 commented on a diff in pull request #2618: IGNITE-20388: Migrate ClusterPerClassIntegrationTest to run queries via public api

Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #2618:
URL: https://github.com/apache/ignite-3/pull/2618#discussion_r1338503789


##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java:
##########
@@ -200,4 +208,40 @@ public static Object generateValueByType(int base, ColumnType type) {
                 throw new IllegalArgumentException("unsupported type " + type);
         }
     }
+
+    /**
+     * Run SQL in given Ignite instance with given transaction and parameters.
+     *
+     * @param ignite Ignite instance to run a query.
+     * @param tx Transaction to run a given query. Can be {@code null} to run within implicit transaction.
+     * @param sql Query to be run.
+     * @param args Dynamic parameters for a given query.
+     * @return List of lists , where outer list represents a rows, internal lists represents a columns.
+     */
+    public static List<List<Object>> sql(Ignite ignite, @Nullable Transaction tx, String sql, Object... args) {
+        try (Session session = ignite.sql().createSession()) {
+            ResultSet<SqlRow> rs = session.execute(tx, sql, args);
+
+            return getAllResultSet(rs);
+        }
+    }

Review Comment:
   ```suggestion
       public static List<List<Object>> sql(Ignite ignite, @Nullable Transaction tx, String sql, Object... args) {
           try (
                   Session session = ignite.sql().createSession();
                   ResultSet<SqlRow> rs = session.execute(tx, sql, args)
           ) {
               return getAllResultSet(rs);
           }
       }
   ```



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/tests/DataTypeTestSpec.java:
##########
@@ -104,6 +104,14 @@ public final Class<?> storageType() {
      * */
     public abstract T wrapIfNecessary(Object storageValue);
 
+    /**
+     * Unwraps {@link NativeTypeWrapper comparable wrapper} into a {@link NativeType}.
+     * If passed values in not wrapped then this method should return original instance.
+     * */

Review Comment:
   ```suggestion
        * Unwraps {@link NativeTypeWrapper comparable wrapper} into a {@link NativeType}.
        *
        * <p>If passed values are not wrapped, then this method should return original instance.
        */
   ```



##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java:
##########
@@ -200,4 +208,40 @@ public static Object generateValueByType(int base, ColumnType type) {
                 throw new IllegalArgumentException("unsupported type " + type);
         }
     }
+
+    /**
+     * Run SQL in given Ignite instance with given transaction and parameters.

Review Comment:
   ```suggestion
        * Run SQL on given Ignite instance with given transaction and parameters.
   ```



##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java:
##########
@@ -200,4 +208,40 @@ public static Object generateValueByType(int base, ColumnType type) {
                 throw new IllegalArgumentException("unsupported type " + type);
         }
     }
+
+    /**
+     * Run SQL in given Ignite instance with given transaction and parameters.
+     *
+     * @param ignite Ignite instance to run a query.
+     * @param tx Transaction to run a given query. Can be {@code null} to run within implicit transaction.
+     * @param sql Query to be run.
+     * @param args Dynamic parameters for a given query.
+     * @return List of lists , where outer list represents a rows, internal lists represents a columns.

Review Comment:
   ```suggestion
        * @return List of lists, where outer list represents a rows, internal lists represents a columns.
   ```



-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2618: IGNITE-20388: Migrate ClusterPerClassIntegrationTest to run queries via public api

Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2618:
URL: https://github.com/apache/ignite-3/pull/2618#discussion_r1338527243


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/tests/DataTypeTestSpec.java:
##########
@@ -104,6 +104,14 @@ public final Class<?> storageType() {
      * */
     public abstract T wrapIfNecessary(Object storageValue);
 
+    /**
+     * Unwraps {@link NativeTypeWrapper comparable wrapper} into a {@link NativeType}.
+     * If passed values in not wrapped then this method should return original instance.
+     * */

Review Comment:
   fixed



-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] xtern merged pull request #2618: IGNITE-20388: Migrate ClusterPerClassIntegrationTest to run queries via public api

Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern merged PR #2618:
URL: https://github.com/apache/ignite-3/pull/2618


-- 
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-unsubscribe@ignite.apache.org

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