You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2021/08/31 11:33:33 UTC
[ignite-3] 01/02: minor
This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a commit to branch ignite-15212
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit b8639facabd825a0767924ff10c6b40fd14f5162
Author: Andrew Mashenkov <an...@gmail.com>
AuthorDate: Tue Aug 3 22:31:11 2021 +0300
minor
---
.../main/java/org/apache/ignite/query/sql/SqlSession.java | 15 ++++++++++++---
modules/sql/src/test/java/SqlTest.java | 4 ++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/modules/api/src/main/java/org/apache/ignite/query/sql/SqlSession.java b/modules/api/src/main/java/org/apache/ignite/query/sql/SqlSession.java
index 229b0e6..8f10010 100644
--- a/modules/api/src/main/java/org/apache/ignite/query/sql/SqlSession.java
+++ b/modules/api/src/main/java/org/apache/ignite/query/sql/SqlSession.java
@@ -25,11 +25,11 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
- * SQL session.
+ * SQL Session provides methods for query execution.
*/
public interface SqlSession extends AsyncSqlSession, ReactiveSqlSession {
/**
- * Executes SQL query synchronously.
+ * Executes SQL query.
*
* @param sql SQL query template.
* @param tx Transaction (optional).
@@ -40,7 +40,7 @@ public interface SqlSession extends AsyncSqlSession, ReactiveSqlSession {
SqlResultSet executeQuery(@NotNull String sql, @Nullable Transaction tx, Object... args);
/**
- * Executes a non-query statement.
+ * Executes DML query.
*
* @param sql SQL statement template.
* @param tx Transaction (optional).
@@ -52,6 +52,15 @@ public interface SqlSession extends AsyncSqlSession, ReactiveSqlSession {
//TODO: in contrary, execute() method may return inserted rows IDs that looks useful if AutoIncrement ID column is used.
/**
+ * Executes DDL query.
+ *
+ * @param sql SQL statement template.
+ * @param tx Transaction (optional).
+ * @param args Agruments for template (optional).
+ */
+ void execute(@NotNull String sql, @Nullable Transaction tx, Object... args);
+
+ /**
* Creates prepared statement.
*
* @param sql SQL query template.
diff --git a/modules/sql/src/test/java/SqlTest.java b/modules/sql/src/test/java/SqlTest.java
index bd693fc..be4958c 100644
--- a/modules/sql/src/test/java/SqlTest.java
+++ b/modules/sql/src/test/java/SqlTest.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+import java.math.BigDecimal;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Flow;
@@ -65,6 +66,9 @@ public class SqlTest {
igniteTx.runInTransaction(tx -> {
SqlSession sess = queryMgr.session();
+// sess.setParameter("forceJoinOrder", true);
+// sess.setParameter("useIndexHint", "idx1"); TODO: Where to move query hints?
+
SqlResultSet rs = sess.executeQuery("SELECT id, val FROM table WHERE id < {} AND val LIKE {};", tx, 10, "str%");
for (SqlRow r : rs) {