Vladsz83 commented on code in PR #11606: URL: https://github.com/apache/ignite/pull/11606#discussion_r1816898170
########## modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KeepBinaryIntegrationTest.java: ########## @@ -97,6 +102,60 @@ public void testKeepBinary() { txAction(client, checker); } + /** */ + @Test + public void testDynamicParameters() { + IgniteCache<Integer, Person> cache = client.cache(CACHE_NAME); + + Person p0 = new Person(0, "name0", null); + Person p1 = new Person(1, "name1", p0); + + put(client, cache, 0, p0); + put(client, cache, 1, p1); + + SupplierX<?> checker = () -> { + for (boolean keepBinary : new boolean[] {true, false}) { + for (String sql : new String[] { + "SELECT ?", + "SELECT _val FROM Person WHERE _val = ?", + "SELECT obj FROM Person WHERE obj = ?" + }) { + SqlFieldsQuery qry = new SqlFieldsQuery(sql).setArgs(p0); + + List<List<?>> res = keepBinary ? cache.withKeepBinary().query(qry).getAll() : cache.query(qry).getAll(); + + assertEquals(1, res.size()); + + if (keepBinary) + assertTrue(res.get(0).get(0) instanceof BinaryObject); + else + assertEquals(p0, res.get(0).get(0)); + } + + SqlFieldsQuery qry = new SqlFieldsQuery("SELECT ?").setArgs(F.asList(p0)); + + List<List<?>> res = keepBinary ? cache.withKeepBinary().query(qry).getAll() : cache.query(qry).getAll(); + + assertEquals(1, res.size()); + + if (keepBinary) { + assertTrue(res.get(0).get(0) instanceof List); + assertTrue(((List<?>)res.get(0).get(0)).get(0) instanceof BinaryObject); + } + else + assertEquals(F.asList(p0), res.get(0).get(0)); + Review Comment: Useless linebreak -- 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