You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "korlov42 (via GitHub)" <gi...@apache.org> on 2023/09/27 12:15:09 UTC
[GitHub] [ignite-3] korlov42 commented on a diff in pull request #2618: IGNITE-20388: Migrate ClusterPerClassIntegrationTest to run queries via public api
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