mihaibudiu commented on code in PR #4331:
URL: https://github.com/apache/calcite/pull/4331#discussion_r2064177016
##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -350,6 +350,16 @@ public static SqlNode convertConditionToSqlNode(RexNode
node,
*/
private static RexNode stripCastFromString(RexNode node, SqlDialect dialect)
{
switch (node.getKind()) {
+ case IS_NULL:
Review Comment:
the problem is that an expression such as 10 = '10' can be interpreted in
two ways:
`CAST(10 AS VARCHAR) = '10'` or `10 = CAST('10' AS INT)`
To strip the cast we have to know what the target dialect would do.
These will NOT produce the same result for all expressions.
In particular, CAST to INT will produce a runtime exception if the value is
not a number, while CAST to VARCHAR will never produce a runtime exception.
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -8268,6 +8268,31 @@ private void checkLiteral2(String expression, String
expected) {
sql(query2).ok(expected2);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6982">[CALCITE-6982]
Review Comment:
does not match new jira title
--
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]