Ken Geis created FLINK-9395: ------------------------------- Summary: multiple left outer joins to subqueries with array values fail Key: FLINK-9395 URL: https://issues.apache.org/jira/browse/FLINK-9395 Project: Flink Issue Type: Bug Reporter: Ken Geis Attachments: JoinTest.java
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} -- This message was sent by Atlassian JIRA (v7.6.3#76005)