walterddr commented on code in PR #10292:
URL: https://github.com/apache/pinot/pull/10292#discussion_r1113353480
##########
pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotPreparedStatementTest.java:
##########
@@ -120,4 +123,30 @@ public void testSetAdditionalDataTypes()
Assert.assertEquals(lastExecutedQuery.substring(0,
lastExecutedQuery.indexOf("LIMIT")).trim(),
String.format("SELECT * FROM dummy WHERE value = '%s'",
Hex.encodeHexString(value.getBytes())));
}
+
+ @Test
+ public void testSetEnableNullHandling()
+ throws Exception {
+ Properties props = new Properties();
+ props.put(QueryOptionKey.ENABLE_NULL_HANDLING, "true");
+ PinotConnection pinotConnection =
+ new PinotConnection(props, "dummy", _dummyPinotClientTransport,
"dummy", _dummyPinotControllerTransport);
+ PreparedStatement preparedStatement =
pinotConnection.prepareStatement(BASIC_TEST_QUERY);
+ preparedStatement.executeQuery();
+ String expectedSql =
DriverUtils.createSetQueryOptionString(QueryOptionKey.ENABLE_NULL_HANDLING) +
BASIC_TEST_QUERY;
+ Assert.assertEquals(expectedSql,
_dummyPinotClientTransport.getLastQuery().substring(0, expectedSql.length()));
+ }
+
+ @Test
+ public void testSetEnableNullHandling2()
+ throws Exception {
+ Properties props = new Properties();
+ props.put(QueryOptionKey.ENABLE_NULL_HANDLING, "true");
+ PinotConnection pinotConnection =
+ new PinotConnection(props, "dummy", _dummyPinotClientTransport,
"dummy", _dummyPinotControllerTransport);
+ PreparedStatement preparedStatement = pinotConnection.prepareStatement("");
+ preparedStatement.executeQuery(BASIC_TEST_QUERY);
Review Comment:
oh no i simply was thinking if there's nothing actually being done in
preparedStatement we can simplify it by testing it together with all the setups
and potentially simplify the code. but we can refactor later
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]