Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-3504

Join fails while have expression inside join condition.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Table SQL / API
    • None

    Description

          val ds1 = CollectionDataSets.get3TupleDataSet(env).as('a, 'b, 'c)
          val ds2 = CollectionDataSets.get5TupleDataSet(env).as('d, 'e, 'f, 'g, 'h)
          val joinT = ds1.join(ds2).filter('a + 3 === 'd).select('c, 'g)
      

      This query would throw exception:

      Caused by: org.apache.flink.api.table.TableException: Joins should have at least one equality condition
      	at org.apache.flink.api.table.plan.rules.dataset.DataSetJoinRule.convert(DataSetJoinRule.scala:57)
      	at org.apache.calcite.rel.convert.ConverterRule.onMatch(ConverterRule.java:116)
      	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:228)
      	... 44 more
      

      There are 2 issues here:

      1. DataSetJoinRule does not support expression inside join condition.
      2. JoinPushExpressionsRulewould add a Project to calculate expression value before Join, so the join condition does not include expression any more, however, it's not returned after the logical optimization.

      Attachments

        Issue Links

          Activity

            People

              fhueske Fabian Hueske
              chengxiang li Chengxiang Li
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: