Aaaaaaron commented on a change in pull request #2056:
URL: https://github.com/apache/calcite/pull/2056#discussion_r451378960
##########
File path:
core/src/test/java/org/apache/calcite/test/TypeCoercionConverterTest.java
##########
@@ -53,6 +67,26 @@
}
/** Test cases for {@link TypeCoercion#inOperationCoercion}. */
+ @Test void testInOperationCoercion() throws SqlParseException {
+ assertFalse(isInCoercion("'1' in ('1', '2', '3')"));
+ assertTrue(isInCoercion("1 in ('1', '2', '3')"));
+ assertTrue(isInCoercion("1 not in ('1', '2', '3')"));
+ }
+
+ private boolean isInCoercion(String expr) throws SqlParseException {
+ final SqlCall inExpr = (SqlCall) SqlParser.create(expr).parseExpression();
+ final RelDataTypeFactory typeFactory =
+ new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
+ final RelDataType charType = typeFactory.createSqlType(SqlTypeName.CHAR);
Review comment:
The test is not very complicated, it just needs a "SqlCallBinding".
----------------------------------------------------------------
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]