[ 
https://issues.apache.org/jira/browse/FLINK-6334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995245#comment-15995245
 ] 

ASF GitHub Bot commented on FLINK-6334:
---------------------------------------

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.


> Refactoring UDTF interface
> --------------------------
>
>                 Key: FLINK-6334
>                 URL: https://issues.apache.org/jira/browse/FLINK-6334
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Ruidong Li
>            Assignee: Ruidong Li
>            Priority: Blocker
>             Fix For: 1.3.0
>
>
> The current UDTF leverages the table.join(expression) interface, which is not 
> a proper interface in terms of semantics. We would like to refactor this to 
> let UDTF use table.join(table) interface. Very briefly,  UDTF's apply method 
> will return a Table Type, so Join(UDTF('a, 'b, ...) as 'c) shall be viewed as 
> join(Table)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to