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

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

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4842#discussion_r145261361
  
    --- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/table/CorrelateITCase.scala
 ---
    @@ -82,6 +82,42 @@ class CorrelateITCase(
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
     
    +  /**
    +    * Due to CALCITE-2004, common join predicates are temporarily 
forbidden.
    +    */
    +  @Test (expected = classOf[ValidationException])
    +  def testLeftOuterJoinWithPredicates(): Unit = {
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tableEnv = TableEnvironment.getTableEnvironment(env, config)
    +    val in = testData(env).toTable(tableEnv).as('a, 'b, 'c)
    +
    +    val func2 = new TableFunc2
    +    val result = in
    +      .leftOuterJoin(func2('c) as ('s, 'l), 'a === 'l)
    +      .select('c, 's, 'l)
    +      .toDataSet[Row]
    +    val results = result.collect()
    +    val expected = "John#19,19,2\n" + "nosharp,null,null"
    +    TestBaseUtils.compareResultAsText(results.asJava, expected)
    +  }
    +
    +  @Test
    +  def testLeftOuterJoinWithWhere(): Unit = {
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tableEnv = TableEnvironment.getTableEnvironment(env, config)
    +    val in = testData(env).toTable(tableEnv).as('a, 'b, 'c)
    +
    +    val func2 = new TableFunc2
    +    val result = in
    +      .leftOuterJoin(func2('c) as ('s, 'l), true)
    +      .where('a >= 'l) // The where clause should be evaluated after the 
join.
    --- End diff --
    
    actually, it can be evaluated before the join because it is on the outer 
side and not on the attributes of the table function. The `testWithFilter()` 
covers the interesting case (`where` and `filter` are identical). 
    
    I think we can remove this test method.


> Reject table function outer joins with predicates in Table API
> --------------------------------------------------------------
>
>                 Key: FLINK-7853
>                 URL: https://issues.apache.org/jira/browse/FLINK-7853
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: Xingcan Cui
>            Assignee: Xingcan Cui
>            Priority: Blocker
>             Fix For: 1.4.0
>
>
> Due to CALCITE-2004, the table function outer joins can not be normally 
> executed. We should cover it up by rejecting join predicates temporarily, 
> until the issue is fixed in Calcite.



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

Reply via email to