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

Outer Joins with array types on the outer join input fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Not a Priority
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Given a table a with a single column id, the following query

      SELECT * FROM (SELECT id, ARRAY[id] AS b FROM a) b
       LEFT OUTER JOIN a AS b ON a.id = b.id
      

      fails with the error:

      org.apache.flink.api.common.InvalidProgramException: Selected sort key is not a sortable type
              at org.apache.flink.api.java.operators.SortPartitionOperator.ensureSortableKey(SortPartitionOperator.java:145)
              at org.apache.flink.api.java.operators.SortPartitionOperator.sortPartition(SortPartitionOperator.java:111)
              at org.apache.flink.table.plan.nodes.dataset.DataSetJoin$$anonfun$partitionAndSort$1.apply(DataSetJoin.scala:466)
              at org.apache.flink.table.plan.nodes.dataset.DataSetJoin$$anonfun$partitionAndSort$1.apply(DataSetJoin.scala:465)
              at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:57)
              at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:66)
              at scala.collection.mutable.ArrayOps$ofInt.foldLeft(ArrayOps.scala:234)
              at org.apache.flink.table.plan.nodes.dataset.DataSetJoin.partitionAndSort(DataSetJoin.scala:465)
              at org.apache.flink.table.plan.nodes.dataset.DataSetJoin.addLeftOuterJoin(DataSetJoin.scala:268)
              at org.apache.flink.table.plan.nodes.dataset.DataSetJoin.translateToPlan(DataSetJoin.scala:176)
              at org.apache.flink.table.api.BatchTableEnvironment.translate(BatchTableEnvironment.scala:399)
              at org.apache.flink.table.api.BatchTableEnvironment.translate(BatchTableEnvironment.scala:378)
              at org.apache.flink.table.api.java.BatchTableEnvironment.toDataSet(BatchTableEnvironment.scala:146)
      

      Attachments

        1. JoinTest.java
          1 kB
          Ken Geis

        Activity

          People

            Unassigned Unassigned
            kgeis Ken Geis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: