You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/08/01 18:41:56 UTC

[GitHub] [incubator-druid] clintropolis commented on a change in pull request #6974: sql support for dynamic parameters

clintropolis commented on a change in pull request #6974: sql support for dynamic parameters
URL: https://github.com/apache/incubator-druid/pull/6974#discussion_r309842970
 
 

 ##########
 File path: sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java
 ##########
 @@ -900,6 +902,39 @@ public void testSqlRequestLog() throws Exception
     Assert.assertEquals(0, testRequestLogger.getSqlQueryLogs().size());
   }
 
+  @Test
+  public void testParameterBinding() throws Exception
+  {
+    PreparedStatement statement = client.prepareStatement("SELECT COUNT(*) AS cnt FROM druid.foo WHERE dim1 = ? OR dim1 = ?");
+    statement.setString(1, "abc");
+    statement.setString(2, "def");
+    final ResultSet resultSet = statement.executeQuery();
+    final List<Map<String, Object>> rows = getRows(resultSet);
+    Assert.assertEquals(
+        ImmutableList.of(
+            ImmutableMap.of("cnt", 2L)
+        ),
+        rows
+    );
+  }
+
+  // this has mocking issues with server discovery and doesn't work, need to fix
 
 Review comment:
   There is no follow-up issue.. i forgot about this test to be honest 😅. It originally worked but over the life of the PR stuff changed beneath it with mocking on sys table stuff that made it not anymore, and I left this as a note to remind me to fix it or delete it and I've done neither of those things yet. Will do.. something with it, not sure yet.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org