hequn8128 commented on a change in pull request #9969:
[FLINK-14022][table-planner][table-planner-blink] Add validation check for
places where Python ScalarFunction cannot be used
URL: https://github.com/apache/flink/pull/9969#discussion_r339889779
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonPhysicalJoin.scala
##########
@@ -49,6 +52,11 @@ abstract class CommonPhysicalJoin(
extends Join(cluster, traitSet, leftRel, rightRel, condition,
Set.empty[CorrelationId], joinType)
with FlinkPhysicalRel {
+ if (containsFunctionOf(condition, FunctionLanguage.PYTHON)) {
+ throw new TableException("Currently except the inner join condition can
support the " +
Review comment:
Maybe we can make the exception message more accurate. Because inner join
may don't support python UDF either(the join should contains equality
predicates), for example the following query is invalid now:
```
val sql =
"""
|SELECT t1.a, t2.c
|FROM leftTable t1 JOIN rightTable t2 ON
| pyFunc(t1.a, t2.a) = t1.a * t2.a
""".stripMargin
```
So, how about change the exception message to:
"Only inner join condition with equality predicates supports the Python UDF
taking the inputs from
the left table and the right table at the same time, e.g., ON T1.id = T2.id
&& pythonUdf(T1.a, T2.b)."
----------------------------------------------------------------
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