MartijnVisser commented on code in PR #30138:
URL: https://github.com/apache/flink/pull/30138#discussion_r4772737852
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/calcite/FlinkCalciteSqlValidator.java:
##########
@@ -172,6 +173,55 @@ public void validateLiteral(SqlLiteral literal) {
super.validateLiteral(literal);
}
+ @Override
+ public void validateCall(SqlCall call, SqlValidatorScope scope) {
+ super.validateCall(call, scope);
+ checkNoNumericAndCharacterStringComparison(call, scope);
+ }
+
+ /**
+ * Rejects a comparison of a numeric with a character string value, e.g.
{@code int_col =
+ * str_col}. It would need an implicit type conversion, which isn't
supported (see FLIP-154), so
+ * code generation would fail on it.
+ */
+ private void checkNoNumericAndCharacterStringComparison(SqlCall call,
SqlValidatorScope scope) {
+ switch (call.getKind()) {
+ case EQUALS:
+ case NOT_EQUALS:
+ case IS_DISTINCT_FROM:
+ case IS_NOT_DISTINCT_FROM:
Review Comment:
`int_col NOT IN (SELECT str_col ...)`, `<> SOME (...)` and `= ALL (...)`
still pass `COMPILE PLAN` and fail at `EXECUTE PLAN` with the old message.
Should their kinds be checked here too?
--
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]