Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/4846#discussion_r145661230
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/FlinkCalciteSqlValidator.scala
---
@@ -48,4 +49,19 @@ class FlinkCalciteSqlValidator(
insert: SqlInsert): RelDataType = {
typeFactory.asInstanceOf[JavaTypeFactory].toSql(targetRowType)
}
+
+ override def validateJoin(join: SqlJoin, scope: SqlValidatorScope): Unit
= {
+ // Due to the improperly translation of lateral table left outer join
(see CALCITE-2004), we
+ // need to temporarily forbid the common predicates until the problem
is fixed.
+ // The check for join with a lateral table is actually quite tricky.
+ if (join.getJoinType == JoinType.LEFT &&
+ join.getRight.toString.startsWith("TABLE(")) { // TABLE
(`func`(`foo`)) AS...
--- End diff --
Yes, you are right.
Let's go for your proposal :-)
Thanks!
---