This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch ignite-14972
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-14972 by this push:
     new 35f4bd390 wip ClientSession.executeAsync - ClientSqlColumnMetadata
35f4bd390 is described below

commit 35f4bd390bdfe04d94524735b7b1b6379fc835e2
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Mon May 30 16:15:29 2022 +0300

    wip ClientSession.executeAsync - ClientSqlColumnMetadata
---
 .../requests/sql/ClientSqlColumnMetadata.java      | 76 ++++++++++++++++++++++
 .../requests/sql/ClientSqlExecuteRequest.java      |  2 +-
 .../ignite/internal/client/sql/ClientSession.java  |  4 ++
 3 files changed, 81 insertions(+), 1 deletion(-)

diff --git 
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlColumnMetadata.java
 
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlColumnMetadata.java
new file mode 100644
index 000000000..f70ec849b
--- /dev/null
+++ 
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlColumnMetadata.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.client.handler.requests.sql;
+
+import org.apache.ignite.sql.ColumnMetadata;
+
+/**
+ * Client SQL column metadata.
+ */
+class ClientSqlColumnMetadata implements ColumnMetadata {
+    /** */
+    private final String name;
+
+    /** */
+    private final Class<?> valueClass;
+
+    /** */
+    private final Object type;
+
+    /** */
+    private final boolean nullable;
+
+    /**
+     * Constructor.
+     *
+     * @param name       Column name.
+     * @param valueClass Value class.
+     * @param type       Column type.
+     * @param nullable   Nullable.
+     */
+    public ClientSqlColumnMetadata(String name, Class<?> valueClass, Object 
type, boolean nullable) {
+        this.name = name;
+        this.valueClass = valueClass;
+        this.type = type;
+        this.nullable = nullable;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String name() {
+        return name;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Class<?> valueClass() {
+        return valueClass;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Object type() {
+        return type;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean nullable() {
+        return nullable;
+    }
+}
diff --git 
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteRequest.java
 
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteRequest.java
index 1b00750fd..fde6a67b0 100644
--- 
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteRequest.java
+++ 
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteRequest.java
@@ -77,7 +77,7 @@ public class ClientSqlExecuteRequest {
                 .queryTimeout(in.unpackLong(), TimeUnit.MILLISECONDS)
                 .prepared(in.unpackBoolean());
 
-        propCount = in.unpackInt();
+        propCount = in.unpackMapHeader();
 
         for (int i = 0; i < propCount; i++) {
             statementBuilder.property(in.unpackString(), 
in.unpackObjectWithType());
diff --git 
a/modules/client/src/main/java/org/apache/ignite/internal/client/sql/ClientSession.java
 
b/modules/client/src/main/java/org/apache/ignite/internal/client/sql/ClientSession.java
index c6907296e..343388e35 100644
--- 
a/modules/client/src/main/java/org/apache/ignite/internal/client/sql/ClientSession.java
+++ 
b/modules/client/src/main/java/org/apache/ignite/internal/client/sql/ClientSession.java
@@ -130,6 +130,10 @@ public class ClientSession implements Session {
             // TODO: Pack statement properties.
             w.out().packMapHeader(0);
         }, r -> {
+            Long resourceId = r.in().tryUnpackNil() ? null : 
r.in().unpackLong();
+            boolean hasRowSet = r.in().unpackBoolean();
+            boolean hasMorePages = r.in().unpackBoolean();
+            boolean wasApplied = r.in().unpackBoolean();
 
         });
     }

Reply via email to