Vladsz83 commented on code in PR #9923:
URL: https://github.com/apache/ignite/pull/9923#discussion_r842896732
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcQueryTest.java:
##########
@@ -87,6 +98,62 @@
stopAllGrids();
}
+ /**
+ * @throws SQLException If failed.
+ */
+ @Test
+ public void testOtherType() throws Exception {
+ List<Object> values = new ArrayList<>();
+
+ values.add("str");
+ values.add(11);
+ values.add(101.1);
+ values.add(202.2f);
+ values.add(new byte[] {1, 2, 3});
+ values.add(UUID.randomUUID());
+ values.add(new ObjectToStore(1, "noname", 22.2));
+
+ Map<String, Object> map = new HashMap<>();
+ map.put("a", "bb");
+ map.put("vvv", "zzz");
+ map.put("111", "222");
+ map.put("lst", Stream.of("abc", 1, null,
20.f).collect(Collectors.toSet()));
+ values.add(map);
+
+ List<Object> lst = new ArrayList<>();
+ lst.add(1);
+ lst.add(2.2f);
+ lst.add(3.3d);
+ lst.add("str");
+ lst.add(map);
+ values.add(lst);
+
+ stmt.execute("CREATE TABLE tbl(id INT, oth OTHER, primary key(id))");
+
+ try (PreparedStatement ps = conn.prepareStatement("insert into tbl
values(?, ?)")) {
+ int idx = 1;
+
+ for (Object obj : values) {
+ ps.setInt(1, idx++);
+
+ ps.setObject(2, obj);
+
+ assertEquals(1, ps.executeUpdate());
+ }
+ }
+
+ try (ResultSet rs = stmt.executeQuery("select * from tbl order by
id")) {
+ for (Object obj : values) {
+ assertTrue(rs.next());
+
+ if (obj != null && obj.getClass().isArray())
Review Comment:
Fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]