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

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

GitHub user xccui opened a pull request:

    https://github.com/apache/flink/pull/4830

    [FLINK-7730] [table] Restrict the predicates of table function left outer 
join

    ## What is the purpose of the change
    
    The PR aims to temporarily cover up the table function left outer join 
problem by adding restrictions on the join predicates. 
    
    ## Brief change log
    
      - Predicates check for table function left outer join (correlate) are 
added to `DataSetCalcRule` and `DataStreamCalcRule`.
      - Update related tests.
      - Refine the documents.
    
    
    ## Verifying this change
    
    This change is already covered by existing tests, such as `CorrelateITCase` 
and `CorrelateTest`.
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): (no)
      - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
      - The serializers: (no)
      - The runtime per-record code paths (performance sensitive): (no)
      - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (no)
      - If yes, how is the feature documented? (docs)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xccui/flink FLINK-7730

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/4830.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4830
    
----
commit 58d2635877f76937cc23d97fe1aa1da8ff51ebd7
Author: Xingcan Cui <xingc...@gmail.com>
Date:   2017-10-16T08:49:14Z

    [FLINK-7730] [table] Add restrictions on table function left outer join

----


> TableFunction LEFT OUTER joins with ON predicates are broken
> ------------------------------------------------------------
>
>                 Key: FLINK-7730
>                 URL: https://issues.apache.org/jira/browse/FLINK-7730
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>    Affects Versions: 1.4.0, 1.3.2
>            Reporter: Fabian Hueske
>            Assignee: Xingcan Cui
>            Priority: Critical
>
> TableFunction left outer joins with predicates in the ON clause are broken. 
> Apparently, the are no tests for this and it has never worked. I observed 
> issues on several layers:
> - Table Function does not correctly validate equality predicate: 
> {{leftOuterJoin(func1('c) as 'd,  'a.cast(Types.STRING) === 'd)}} is rejected 
> because the predicate is not considered as an equality predicate (the cast 
> needs to be pushed down).
> - Plans cannot be correctly translated: {{leftOuterJoin(func1('c) as 'd,  'c 
> === 'd)}} gives an optimizer exception.
> - SQL queries get translated but produce incorrect results. For example 
> {{SELECT a, b, c, d FROM MyTable LEFT OUTER JOIN LATERAL TABLE(tfunc(c)) AS 
> T(d) ON d = c}} returns an empty result if the condition {{d = c}} never 
> returns true. However, the outer side should be preserved and padded with 
> nulls.
> So there seem to be many issues with table function outer joins. Especially, 
> the wrong result produced by SQL queries need to be quickly fixed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to