Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3791#discussion_r114590580 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala --- @@ -417,13 +507,45 @@ class Table( } private def join(right: Table, joinPredicate: Option[Expression], joinType: JoinType): Table = { - // check that right table belongs to the same TableEnvironment - if (right.tableEnv != this.tableEnv) { + if (UserDefinedFunctionUtils.verifyTableFunctionCallExistence(this)) { + throw new ValidationException( + "TableFunctions can only be followed by Alias. e.g table.join(split('c) as ('a, 'b))") + } + + // check that the TableEnvironment of right table is not null + // and right table belongs to the same TableEnvironment + if (right.tableEnv != null && right.tableEnv != this.tableEnv) { --- End diff -- I would change this method as follows: first we check if `right` is a table function call. If no, we translate the join as before. Otherwise, we translate it as a join with a table function.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---