clintropolis commented on a change in pull request #6974: sql support for
dynamic parameters
URL: https://github.com/apache/druid/pull/6974#discussion_r370594225
##########
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:
fixed the tests/mocking so there is coverage on using parameters with system
tables queries
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]