Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Repro:
In SqlToRelConverterTest.java, add the following case:
@Test public void testStreamLateralJoin() { final String sql = "select stream *\n" + "from orders\n" + "cross join lateral (" + " select * from products_temporal for system_time as of orders.rowtime\n" + " where orders.productid = products_temporal.productid)\n"; sql(sql).ok(); }
We will see the exception:
java.lang.RuntimeException: While invoking method 'public org.apache.calcite.sql2rel.RelDecorrelator$Frame org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(org.apache.calcite.rel.RelNode)' at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:527) at org.apache.calcite.sql2rel.RelDecorrelator.getInvoke(RelDecorrelator.java:613) at org.apache.calcite.sql2rel.RelDecorrelator.decorrelate(RelDecorrelator.java:254) at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateQuery(RelDecorrelator.java:214) at org.apache.calcite.sql2rel.SqlToRelConverter.decorrelateQuery(SqlToRelConverter.java:3073) at org.apache.calcite.sql2rel.SqlToRelConverter.decorrelate(SqlToRelConverter.java:483) at org.apache.calcite.test.SqlToRelTestBase$TesterImpl.convertSqlToRel(SqlToRelTestBase.java:616) at org.apache.calcite.test.SqlToRelTestBase$TesterImpl.assertConvertsTo(SqlToRelTestBase.java:723) at org.apache.calcite.test.SqlToRelConverterTest$Sql.convertsTo(SqlToRelConverterTest.java:3096) at org.apache.calcite.test.SqlToRelConverterTest$Sql.ok(SqlToRelConverterTest.java:3088) ......... Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:524) ... 32 more Caused by: java.lang.RuntimeException: While invoking method 'public org.apache.calcite.sql2rel.RelDecorrelator$Frame org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(org.apache.calcite.rel.logical.LogicalProject)' at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:527) at org.apache.calcite.sql2rel.RelDecorrelator.getInvoke(RelDecorrelator.java:613) at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:369)
Inside
public Frame decorrelateRel(LogicalCorrelate rel)
, assertion failure happened:
assert rel.getRequiredColumns().cardinality()
<= rightFrame.corDefOutputs.keySet().size();
Attachments
Issue Links
- blocks
-
CALCITE-2004 The TableFunction left outer join was improperly translated
- Closed
- links to