You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/12/20 15:50:55 UTC

[GitHub] [ignite-3] agura commented on a change in pull request #326: IGNITE-15212 Add SQL API

agura commented on a change in pull request #326:
URL: https://github.com/apache/ignite-3/pull/326#discussion_r772403497



##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL Session provides methods for query execution.
+ */
+public interface Session extends AsyncSession, ReactiveSession {
+    /**
+     * Sets default query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void defaultTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets default query timeout.
+     *
+     * @param timeUnit Timeunit.
+     * @return Default query timeout.
+     */
+    long defaultTimeout(TimeUnit timeUnit);
+
+    /**
+     * Sets default query schema.
+     *
+     * @param schema Default schema.
+     */
+    void defaultSchema(@NotNull String schema);
+
+    /**
+     * Gets default query schema.
+     *
+     * @return Default query schema.
+     */
+    String defaultSchema();
+
+    /**
+     * Executes single SQL query.
+     *
+     * @param query       SQL query template.
+     * @param arguments   Arguments for the template (optional).

Review comment:
       Could you please reorder parameters descriptions accordingly to order of method signature parameters?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL Session provides methods for query execution.
+ */
+public interface Session extends AsyncSession, ReactiveSession {
+    /**
+     * Sets default query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void defaultTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets default query timeout.
+     *
+     * @param timeUnit Timeunit.
+     * @return Default query timeout.
+     */
+    long defaultTimeout(TimeUnit timeUnit);
+
+    /**
+     * Sets default query schema.
+     *
+     * @param schema Default schema.
+     */
+    void defaultSchema(@NotNull String schema);
+
+    /**
+     * Gets default query schema.
+     *
+     * @return Default query schema.
+     */
+    String defaultSchema();
+
+    /**
+     * Executes single SQL query.
+     *
+     * @param query       SQL query template.

Review comment:
       Please, prefer not aligned comments relatively parameters name. It is hard to support.

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Statement.java
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * The object represents parameterized SQL query statement that supports batched query, and provides methods for managing it`s state.
+ */
+public interface Statement {
+    /**
+     * Returns SQL statement string representation.
+     *
+     * @return SQL statement string.
+     */
+    String query();
+
+    /**
+     * Returns SQL statement parameters.
+     *
+     * @return SQL statement parameters.
+     */
+    Object[] parameters();

Review comment:
       Is return value is a copy of arguments or returned array could be changed by user? 

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Statement.java
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * The object represents parameterized SQL query statement that supports batched query, and provides methods for managing it`s state.
+ */
+public interface Statement {
+    /**
+     * Returns SQL statement string representation.
+     *
+     * @return SQL statement string.
+     */
+    String query();
+
+    /**
+     * Returns SQL statement parameters.
+     *
+     * @return SQL statement parameters.
+     */
+    Object[] parameters();
+
+    /**
+     * Sets SQL statement parameters.
+     *
+     * @param parameters SQL statement parameters.
+     * @return {@code this} for chaining.
+     */
+    Statement parameters(Object... parameters);
+
+    /**
+     * Sets SQL statement parameter value by the parameter index.
+     *
+     * @param index Parameter index.
+     * @param value Parameter value.
+     * @return {@code this} for chaining.
+     */
+    Statement parameter(int index, Object value);
+
+    /**
+     * Resets batch state and clears query parameters.

Review comment:
       What does it mean from an user perspective?
   Why does the method two things?
   
   I mean it should be documented better.

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Statement.java
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * The object represents parameterized SQL query statement that supports batched query, and provides methods for managing it`s state.
+ */
+public interface Statement {
+    /**
+     * Returns SQL statement string representation.
+     *
+     * @return SQL statement string.
+     */
+    String query();
+
+    /**
+     * Returns SQL statement parameters.
+     *
+     * @return SQL statement parameters.
+     */
+    Object[] parameters();
+
+    /**
+     * Sets SQL statement parameters.
+     *
+     * @param parameters SQL statement parameters.
+     * @return {@code this} for chaining.
+     */
+    Statement parameters(Object... parameters);
+
+    /**
+     * Sets SQL statement parameter value by the parameter index.
+     *
+     * @param index Parameter index.
+     * @param value Parameter value.
+     * @return {@code this} for chaining.
+     */
+    Statement parameter(int index, Object value);
+
+    /**
+     * Resets batch state and clears query parameters.
+     *
+     * @return {@code this} for chaining.
+     */
+    Statement resetState();
+
+    /**
+     * Adds a set of parameters to this statement object's batch of commands.
+     *
+     * @return {@code this} for chaining.
+     */
+    Statement addBatch() throws SqlException;
+
+    /**
+     * Sets query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void queryTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets query timeout.
+     *
+     * @param timeUnit Timeunit.
+     * @return Query timeout.
+     */
+    long queryTimeout(TimeUnit timeUnit);

Review comment:
       Could you please specify units for the return value?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/async/AsyncSession.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql.async;
+
+import java.util.concurrent.CompletableFuture;
+import org.apache.ignite.sql.SqlException;
+import org.apache.ignite.sql.Statement;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Async Session provides methods for asynchronous query execution.
+ */
+public interface AsyncSession {
+    /**
+     * Executes SQL query in async way.
+     *
+     * @param query       SQL query template.
+     * @param transaction Transaction to execute the query within or {@code null}.
+     * @param arguments   Arguments for the template (optional).
+     * @return Operation future.
+     * @throws SqlException If failed.
+     */
+    CompletableFuture<AsyncResultSet> executeAsync(@NotNull String query, @Nullable Transaction transaction, Object... arguments);

Review comment:
       What about `arguments` nullability?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/async/AsyncResultSet.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql.async;
+
+import java.util.concurrent.CompletionStage;
+import org.apache.ignite.sql.ResultSetMetadata;
+import org.apache.ignite.sql.SqlRow;
+
+/**
+ * Asynchronous result set.
+ */
+public interface AsyncResultSet {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();
+    
+    /**
+     * Returns whether the result set contains rows (SELECT query result), or not (for query of DML, DDL or other kind).
+     *
+     * @return {@code True} if result set contains rows, {@code false} otherwise.
+     */
+    boolean hasRowSet();
+    
+    /**
+     * Returns number of row affected by DML query.
+     *
+     * @return Number of rows.
+     */
+    int updateCount();
+    
+    /**
+     * Returns result for the conditional query.
+     *
+     * @return {@code True} if conditional query applied, {@code false} otherwise.
+     */
+    boolean wasApplied();
+    
+    /**
+     * Returns the current page content.
+     *
+     * @return Iterable over rows.
+     */
+    Iterable<SqlRow> currentPage();

Review comment:
       @AMashenkov I don't see any methods for page size control on `AsyncSession` interface.

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL Session provides methods for query execution.
+ */
+public interface Session extends AsyncSession, ReactiveSession {
+    /**
+     * Sets default query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void defaultTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets default query timeout.

Review comment:
       Actually the method returns result, not gets. To get do not mean to return :)
   
   Also, could you please specify units for the return value?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL Session provides methods for query execution.
+ */
+public interface Session extends AsyncSession, ReactiveSession {
+    /**
+     * Sets default query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void defaultTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets default query timeout.
+     *
+     * @param timeUnit Timeunit.
+     * @return Default query timeout.
+     */
+    long defaultTimeout(TimeUnit timeUnit);
+
+    /**
+     * Sets default query schema.
+     *
+     * @param schema Default schema.
+     */
+    void defaultSchema(@NotNull String schema);

Review comment:
       What is the default schema? Why should an user specify the default schema?
   
   This aspects should be documented in javadoc.

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Statement.java
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * The object represents parameterized SQL query statement that supports batched query, and provides methods for managing it`s state.
+ */
+public interface Statement {

Review comment:
       Could you please specify contract in more strict way using `@Nullable` and `@NotNull` annotations for methods parameters and return values?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL Session provides methods for query execution.
+ */
+public interface Session extends AsyncSession, ReactiveSession {
+    /**
+     * Sets default query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void defaultTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets default query timeout.
+     *
+     * @param timeUnit Timeunit.
+     * @return Default query timeout.
+     */
+    long defaultTimeout(TimeUnit timeUnit);
+
+    /**
+     * Sets default query schema.
+     *
+     * @param schema Default schema.
+     */
+    void defaultSchema(@NotNull String schema);
+
+    /**
+     * Gets default query schema.
+     *
+     * @return Default query schema.
+     */
+    String defaultSchema();
+
+    /**
+     * Executes single SQL query.
+     *
+     * @param query       SQL query template.
+     * @param arguments   Arguments for the template (optional).
+     * @param transaction Transaction to execute the query within or {@code null}.
+     * @return SQL query results set.
+     * @throws SqlException If failed.
+     */
+    ResultSet execute(@NotNull String query, @Nullable Transaction transaction, Object... arguments);

Review comment:
       Could be the `arguments` be `null`?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL Session provides methods for query execution.
+ */
+public interface Session extends AsyncSession, ReactiveSession {
+    /**
+     * Sets default query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void defaultTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets default query timeout.
+     *
+     * @param timeUnit Timeunit.
+     * @return Default query timeout.
+     */
+    long defaultTimeout(TimeUnit timeUnit);
+
+    /**
+     * Sets default query schema.
+     *
+     * @param schema Default schema.
+     */
+    void defaultSchema(@NotNull String schema);
+
+    /**
+     * Gets default query schema.
+     *
+     * @return Default query schema.
+     */
+    String defaultSchema();
+
+    /**
+     * Executes single SQL query.
+     *
+     * @param query       SQL query template.
+     * @param arguments   Arguments for the template (optional).
+     * @param transaction Transaction to execute the query within or {@code null}.
+     * @return SQL query results set.
+     * @throws SqlException If failed.
+     */
+    ResultSet execute(@NotNull String query, @Nullable Transaction transaction, Object... arguments);
+
+    /**
+     * Executes single SQL statement.
+     *
+     * @param statement   SQL statement to execute.
+     * @param transaction Transaction to execute the statement within or {@code null}.
+     * @return SQL query results set.
+     */
+    ResultSet execute(@NotNull Statement statement, @Nullable Transaction transaction);
+
+    /**
+     * Executes multi-statement non-transactional SQL query.
+     *
+     * @param query     SQL query template.
+     * @param arguments Arguments for the template (optional).
+     * @throws SqlException If failed.
+     */
+    void executeScript(@NotNull String query, Object... arguments);

Review comment:
       Couldbe the `arguments` parameter be `null`?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Statement.java
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * The object represents parameterized SQL query statement that supports batched query, and provides methods for managing it`s state.
+ */
+public interface Statement {
+    /**
+     * Returns SQL statement string representation.
+     *
+     * @return SQL statement string.
+     */
+    String query();
+
+    /**
+     * Returns SQL statement parameters.
+     *
+     * @return SQL statement parameters.
+     */
+    Object[] parameters();
+
+    /**
+     * Sets SQL statement parameters.
+     *
+     * @param parameters SQL statement parameters.
+     * @return {@code this} for chaining.
+     */
+    Statement parameters(Object... parameters);
+
+    /**
+     * Sets SQL statement parameter value by the parameter index.
+     *
+     * @param index Parameter index.
+     * @param value Parameter value.
+     * @return {@code this} for chaining.
+     */
+    Statement parameter(int index, Object value);
+
+    /**
+     * Resets batch state and clears query parameters.
+     *
+     * @return {@code this} for chaining.
+     */
+    Statement resetState();
+
+    /**
+     * Adds a set of parameters to this statement object's batch of commands.
+     *
+     * @return {@code this} for chaining.
+     */
+    Statement addBatch() throws SqlException;

Review comment:
       The naming looks confusing to me. It seems that method should get some parameters but it don't get it. Also, it looks like we add a batch of something to the statement, but in fact, we add the statement to a batch.  It seems the `batch` or `addToBatch` are better names. 
   

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/ResultSet.java
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+/**
+ * SQL result set provides methods to access SQL query result represented as collection of {@link SqlRow}.
+ *
+ * <p>All the rows in result set have the same structure described in {@link ResultSetMetadata}.
+ * ResultSet must be closed after usage to free resources.
+ */
+public interface ResultSet extends Iterable<SqlRow>, AutoCloseable {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();

Review comment:
       What will be returned for a result set which don't have a row set (hasRowSet() == false)?
   
   What will be returned for a statement which didn't applied (wasApplied() == false)?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/IgniteSql.java
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Ignite SQL query facade.
+ */
+public interface IgniteSql {
+    /**
+     * Creates SQL session.
+     *
+     * @return Session.
+     */
+    Session newSession();

Review comment:
       We use `create` prefix everywhere. Could you please rename the method to `createSession`?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/ResultSet.java
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+/**
+ * SQL result set provides methods to access SQL query result represented as collection of {@link SqlRow}.
+ *
+ * <p>All the rows in result set have the same structure described in {@link ResultSetMetadata}.
+ * ResultSet must be closed after usage to free resources.
+ */
+public interface ResultSet extends Iterable<SqlRow>, AutoCloseable {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();
+
+    /**
+     * Returns whether the result set contains rows (SELECT query result), or not (for query of DML, DDL or other kind).
+     *
+     * @return {@code True} if result set contains rows, {@code false} otherwise.
+     */
+    boolean hasRowSet();
+
+    /**
+     * Returns number of row affected by the query.

Review comment:
       Number of row**s** (plural)

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/IgniteSql.java
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Ignite SQL query facade.
+ */
+public interface IgniteSql {
+    /**
+     * Creates SQL session.
+     *
+     * @return Session.
+     */
+    Session newSession();
+
+    /**
+     * Creates statement.
+     *
+     * @param sql SQL query template.
+     * @return Prepared statement.
+     * @throws SqlException If parsing failed.
+     */
+    Statement newStatement(@NotNull String sql);

Review comment:
       We use `create` prefix everywhere. Could you please rename the method to `createStatement`?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL Session provides methods for query execution.
+ */
+public interface Session extends AsyncSession, ReactiveSession {
+    /**
+     * Sets default query timeout.
+     *
+     * @param timeout  Query timeout value.
+     * @param timeUnit Timeunit.
+     */
+    void defaultTimeout(long timeout, TimeUnit timeUnit);
+
+    /**
+     * Gets default query timeout.
+     *
+     * @param timeUnit Timeunit.
+     * @return Default query timeout.
+     */
+    long defaultTimeout(TimeUnit timeUnit);
+
+    /**
+     * Sets default query schema.
+     *
+     * @param schema Default schema.
+     */
+    void defaultSchema(@NotNull String schema);
+
+    /**
+     * Gets default query schema.
+     *
+     * @return Default query schema.
+     */
+    String defaultSchema();
+
+    /**
+     * Executes single SQL query.
+     *
+     * @param query       SQL query template.
+     * @param arguments   Arguments for the template (optional).
+     * @param transaction Transaction to execute the query within or {@code null}.
+     * @return SQL query results set.
+     * @throws SqlException If failed.
+     */
+    ResultSet execute(@NotNull String query, @Nullable Transaction transaction, Object... arguments);
+
+    /**
+     * Executes single SQL statement.
+     *
+     * @param statement   SQL statement to execute.
+     * @param transaction Transaction to execute the statement within or {@code null}.
+     * @return SQL query results set.
+     */
+    ResultSet execute(@NotNull Statement statement, @Nullable Transaction transaction);
+
+    /**
+     * Executes multi-statement non-transactional SQL query.

Review comment:
       Why is this method non-transactional? Is it possible to execute multiple DML (not DDL) statements in one transaction? I think, the answer is yes.

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/ResultSet.java
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+/**
+ * SQL result set provides methods to access SQL query result represented as collection of {@link SqlRow}.
+ *
+ * <p>All the rows in result set have the same structure described in {@link ResultSetMetadata}.
+ * ResultSet must be closed after usage to free resources.
+ */
+public interface ResultSet extends Iterable<SqlRow>, AutoCloseable {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();
+
+    /**
+     * Returns whether the result set contains rows (SELECT query result), or not (for query of DML, DDL or other kind).
+     *
+     * @return {@code True} if result set contains rows, {@code false} otherwise.
+     */
+    boolean hasRowSet();
+
+    /**
+     * Returns number of row affected by the query.
+     *
+     * @return Number of rows or {@code -1} if unapplicable.
+     */
+    int updateCount();
+
+    /**
+     * Returns result for the conditional query.
+     *
+     * @return {@code True} if conditional query applied, {@code false} otherwise.
+     */
+    boolean wasApplied();

Review comment:
       Naming: may be just `applied`? We already has result set and at this moment the result set is already applied or not applied (and will not be applied).

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/ResultSet.java
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+/**
+ * SQL result set provides methods to access SQL query result represented as collection of {@link SqlRow}.
+ *
+ * <p>All the rows in result set have the same structure described in {@link ResultSetMetadata}.
+ * ResultSet must be closed after usage to free resources.
+ */
+public interface ResultSet extends Iterable<SqlRow>, AutoCloseable {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();
+
+    /**
+     * Returns whether the result set contains rows (SELECT query result), or not (for query of DML, DDL or other kind).
+     *
+     * @return {@code True} if result set contains rows, {@code false} otherwise.
+     */
+    boolean hasRowSet();
+
+    /**
+     * Returns number of row affected by the query.
+     *
+     * @return Number of rows or {@code -1} if unapplicable.

Review comment:
       "Not applicable" on "inapplicable" instead of "unapplicable".

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/ResultSetMetadata.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.List;
+
+/**
+ * ResultSet metadata.
+ */
+public interface ResultSetMetadata {
+    /**
+     * Returns number of column that every row in a result set contains.

Review comment:
       column**s** (plural)

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/SqlException.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import org.apache.ignite.lang.IgniteException;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * SQL exception base class.
+ */
+public class SqlException extends IgniteException {
+    /**
+     * Creates an empty exception.
+     */
+    public SqlException() {

Review comment:
       I think we should remove default constructor or make it non-public.

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/async/AsyncResultSet.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql.async;
+
+import java.util.concurrent.CompletionStage;
+import org.apache.ignite.sql.ResultSetMetadata;
+import org.apache.ignite.sql.SqlRow;
+
+/**
+ * Asynchronous result set.
+ */
+public interface AsyncResultSet {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();
+
+    /**
+     * Returns whether the result set contains rows (SELECT query result), or not (for query of DML, DDL or other kind).
+     *
+     * @return {@code True} if result set contains rows, {@code false} otherwise.
+     */
+    boolean hasRowSet();
+
+    /**
+     * Returns number of row affected by DML query.
+     *
+     * @return Number of rows.
+     */
+    int updateCount();
+
+    /**
+     * Returns result for the conditional query.
+     *
+     * @return {@code True} if conditional query applied, {@code false} otherwise.
+     */
+    boolean wasApplied();
+
+    /**
+     * Returns the current page content.
+     *
+     * @return Iterable over rows.
+     */
+    Iterable<SqlRow> currentPage();
+
+    /**
+     * Fetch the next page of results asynchronously.
+     *
+     * @return Operation future.
+     */
+    CompletionStage<? extends AsyncResultSet> fetchNextPageAsync();

Review comment:
       `Async` suffix is redundant here because we already use `AsyncResultSet`.

##########
File path: modules/client/src/main/java/org/apache/ignite/internal/client/TcpIgniteClient.java
##########
@@ -103,10 +104,15 @@ public IgniteTransactions transactions() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override public void setBaseline(Set<String> baselineNodes) {
+    /** {@inheritDoc} */
+    @Override
+    public IgniteSql sql() {
+        return null;

Review comment:
       Why `null`?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/Session.java
##########
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.sql.async.AsyncSession;
+import org.apache.ignite.sql.reactive.ReactiveSession;
+import org.apache.ignite.tx.Transaction;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * SQL Session provides methods for query execution.

Review comment:
       @AMashenkov Andrey, the fact that session could be used from different threads but should not be modified from different threads is still not documented.

##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -359,6 +360,12 @@ public IgniteTransactions transactions() {
         return null;
     }
 
+    /** {@inheritDoc} */
+    @Override
+    public IgniteSql sql() {
+        return null;

Review comment:
       Why `null`?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/ResultSet.java
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+/**
+ * SQL result set provides methods to access SQL query result represented as collection of {@link
+ * SqlRow}.
+ *
+ * <p>All the rows in result set have the same structure described in {@link ResultSetMetadata}.
+ * ResultSet must be closed after usage to free resources.
+ */
+public interface ResultSet extends Iterable<SqlRow>, AutoCloseable {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();
+    
+    /**
+     * Returns whether the result set contains rows (SELECT query result), or not (for query of DML, DDL or other kind).
+     *
+     * @return {@code True} if result set contains rows, {@code false} otherwise.
+     */
+    boolean hasRowSet();
+    
+    /**
+     * Returns number of row affected by DML query.
+     *
+     * @return Number of rows or {@code -1} if unapplicable.
+     */
+    int updateCount();
+    
+    /**
+     * Returns result for the conditional query.
+     *
+     * @return {@code True} if conditional query applied, {@code false} otherwise.
+     */
+    boolean wasApplied();

Review comment:
       @AMashenkov Could you please clarify in javadoc what is "conditional query" and what does it mean "applied"?

##########
File path: modules/api/src/main/java/org/apache/ignite/sql/ResultSet.java
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.sql;
+
+/**
+ * SQL result set provides methods to access SQL query result represented as collection of {@link
+ * SqlRow}.
+ *
+ * <p>All the rows in result set have the same structure described in {@link ResultSetMetadata}.
+ * ResultSet must be closed after usage to free resources.
+ */
+public interface ResultSet extends Iterable<SqlRow>, AutoCloseable {
+    /**
+     * Returns metadata for the results.
+     *
+     * @return ResultSet metadata.
+     */
+    ResultSetMetadata metadata();
+    
+    /**
+     * Returns whether the result set contains rows (SELECT query result), or not (for query of DML, DDL or other kind).

Review comment:
       @AMashenkov Okay, accordingly to your answer the javadoc must be should be clarified. How should an user know the information provided you in your answer? :)




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