ccaominh commented on a change in pull request #6974: sql support for dynamic
parameters
URL: https://github.com/apache/incubator-druid/pull/6974#discussion_r309816132
##########
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:
If there's already a tracking issue for the following up work, it can be
referenced here.
Optionally, `@Ignore` accepts a parameter for documenting why the test is
ignored: http://junit.sourceforge.net/javadoc/org/junit/Ignore.html#value()
----------------------------------------------------------------
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]