xtern commented on code in PR #4692:
URL: https://github.com/apache/ignite-3/pull/4692#discussion_r1837661655


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestClusterTest.java:
##########
@@ -361,4 +366,40 @@ public void testGetCountPlan() {
         List<List<Object>> rows = convertSqlRows(results.items());
         assertEquals(List.of(List.of("hello", 42L)), rows);
     }
+
+    @Test
+    public void testExecutionWithDynamicParam() {
+        cluster.start();
+
+        TestNode node = cluster.node("N1");
+        Object[] params = {1, null};
+
+        QueryPlan plan = node.prepare("SELECT ?, ?", params);
+        AsyncDataCursor<InternalSqlRow> cursor = node.executePlan(plan, 
params);
+        BatchedResult<InternalSqlRow> res = await(cursor.requestNextAsync(1));
+
+        assertThat(res.hasMore(), is(false));
+        assertThat(res.items(), hasSize(1));
+        assertThat(res.items().get(0).fieldCount(), is(2));
+        assertThat(res.items().get(0).get(0), is(1));
+        assertThat(res.items().get(0).get(1), nullValue());
+    }
+
+    @Test
+    public void testExecutionWithMissingDynamicParam() {
+        cluster.start();
+
+        TestNode node = cluster.node("N1");
+
+        QueryPlan plan = node.prepare("SELECT ?/?", 1, 0);

Review Comment:
   > I found that prepare with dyn params is called only from your test, do we 
need such a method in such a case ?
   
   This is exactly what needs to be done in this task (see description 
[IGNITE-23317](https://issues.apache.org/jira/browse/IGNITE-23317) - add the 
ability to pass dynamic parameters in the test cluster..
   
   > dyn params passed into prepare and executePlan methods can be different, 
seems strange.
   
   Yes, this is possible, when we using our test cluster in our tests. What is 
your proposal?
   
   > call prepare with missed dyn parameter not raise any exception
   
   This is expected behavior for binary operations, we're using inferred type 
(INTEGER) for the second argument, when it is UNKNOWN



-- 
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-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to