danny0405 commented on a change in pull request #1437: [CALCITE-3318] 
Preserving CAST of STRING operands in comparison operator
URL: https://github.com/apache/calcite/pull/1437#discussion_r336395573
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java
 ##########
 @@ -99,6 +103,14 @@ public BigQuerySqlDialect(SqlDialect.Context context) {
     return emulateNullDirectionWithIsNull(node, nullsFirst, desc);
   }
 
+  @Override public boolean supportsImplicitTypeCoercion(RexCall node) {
+    if (!super.supportsImplicitTypeCoercion(node)) {
+      return false;
+    }
+    RexNode operand = node.getOperands().get(0);
+    return operand instanceof RexLiteral && 
!SqlTypeFamily.NUMERIC.contains(node.type);
+  }
+
 
 Review comment:
   Thanks for the explain, i think we should match the cases that we exactly 
know well, because the implicit type coercion rules are relevant with many sql 
contexts.

----------------------------------------------------------------
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

Reply via email to