[ https://issues.apache.org/jira/browse/FLINK-9395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabian Hueske updated FLINK-9395: --------------------------------- Description: Given a table {{a}} with a single column {{id}}, the following query {code:sql} SELECT * FROM (SELECT id, ARRAY[id] AS b FROM a) b LEFT OUTER JOIN a AS b ON a.id = b.id {code} fails with the error: {noformat} 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) {noformat} was: Where {{a}} is a table with column {{id}}, the following query succeeds: {code:sql} SELECT * FROM a LEFT OUTER JOIN (SELECT id, ARRAY[id] AS b FROM a) AS b ON a.id = b.id {code} I add another join: {code:sql} SELECT * FROM a LEFT OUTER JOIN (SELECT id, ARRAY[id] AS b FROM a) AS b ON a.id = b.id LEFT OUTER JOIN (SELECT id, ARRAY[id] AS b FROM a) AS c ON a.id = c.id {code} This fails with the error: {noformat} 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) {noformat} > Outer Joins with array types on the outer join input fail > --------------------------------------------------------- > > Key: FLINK-9395 > URL: https://issues.apache.org/jira/browse/FLINK-9395 > Project: Flink > Issue Type: Bug > Reporter: Ken Geis > Priority: Major > Attachments: JoinTest.java > > > Given a table {{a}} with a single column {{id}}, the following query > {code:sql} > SELECT * FROM (SELECT id, ARRAY[id] AS b FROM a) b > LEFT OUTER JOIN a AS b ON a.id = b.id > {code} > fails with the error: > {noformat} > 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) > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)