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 2022/06/03 11:08:37 UTC

[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #832: IGNITE-16962: SQL API: Implement query metadata

ygerzhedovich commented on code in PR #832:
URL: https://github.com/apache/ignite-3/pull/832#discussion_r888846953


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java:
##########
@@ -192,6 +197,40 @@ public void select() throws ExecutionException, InterruptedException {
         checkSession(ses);
     }
 
+    @Test
+    public void metadata() throws ExecutionException, InterruptedException {
+        sql("CREATE TABLE TEST(COL0 BIGINT PRIMARY KEY, COL1 VARCHAR NOT NULL)");
+        sql("INSERT INTO TEST VALUES (?, ?)", 1L, "some string");
+
+        IgniteSql sql = CLUSTER_NODES.get(0).sql();
+        Session ses = sql.sessionBuilder().build();
+
+        AsyncResultSet rs = ses.executeAsync(null, "SELECT COL1, COL0 FROM TEST").get();
+
+        // Validata columns metadata.
+        ResultSetMetadata meta = rs.metadata();
+
+        assertNotNull(meta);
+        assertEquals(-1, meta.indexOf("COL"));
+        assertEquals(0, meta.indexOf("COL1"));
+        assertEquals(1, meta.indexOf("COL0"));
+
+        //TODO: Fix nullability issue

Review Comment:
   What does it mean?



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