git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2297) throws NPE in RelDecorrelator when optimizing Correlated SubQuery in Having


godfrey he created CALCITE-2297:
-----------------------------------

             Summary: throws NPE in RelDecorrelator when optimizing Correlated SubQuery in Having
                 Key: CALCITE-2297
                 URL: https://issues.apache.org/jira/browse/CALCITE-2297
             Project: Calcite
          Issue Type: Bug
            Reporter: godfrey he
            Assignee: Julian Hyde


when running the following test, we will get NPE.
{code}
 @Test public void testDecorrelateWithHavingAgg() throws Exception {
    final String sql = "select ename\n"
                       + "from sales.emp\n"
                       + "group by ename, deptno\n"
                       + "having max(sal) <= \n"
                       + "  (select max(sal) from sales.emp_b where " 
                       + "emp.deptno = emp_b.deptno group by ename)";
    checkSubQuery(sql).withLateDecorrelation(true).check();
  }
{code}

{code}
	at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:527)
	at org.apache.calcite.sql2rel.RelDecorrelator.getInvoke(RelDecorrelator.java:622)
	at org.apache.calcite.sql2rel.RelDecorrelator.decorrelate(RelDecorrelator.java:261)
	at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateQuery(RelDecorrelator.java:221)
	at org.apache.calcite.test.RelOptTestBase.checkPlanning(RelOptTestBase.java:177)
	at org.apache.calcite.test.RelOptTestBase$Sql.check(RelOptTestBase.java:315)
	at org.apache.calcite.test.RelOptTestBase$Sql.check(RelOptTestBase.java:299)
	at org.apache.calcite.test.RelOptRulesTest.testDecorrelateWithHavingAgg(RelOptRulesTest.java:3720)
	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
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)
	... 29 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:622)
	at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:655)
	... 34 more
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)
	... 36 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:622)
	at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:655)
	... 41 more
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)
	... 43 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.LogicalFilter)'
	at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:527)
	at org.apache.calcite.sql2rel.RelDecorrelator.getInvoke(RelDecorrelator.java:622)
	at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:655)
	... 48 more
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)
	... 50 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.LogicalCorrelate)'
	at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:527)
	at org.apache.calcite.sql2rel.RelDecorrelator.getInvoke(RelDecorrelator.java:622)
	at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:1017)
	... 55 more
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)
	... 57 more
Caused by: java.lang.NullPointerException
	at org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:1101)
	... 62 more
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-calcite-development/msg03384.html on line 190
Call Stack
#TimeMemoryFunctionLocation
10.0007372920{main}( ).../msg03384.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-calcite-development/msg03384.html on line 190
Call Stack
#TimeMemoryFunctionLocation
10.0007372920{main}( ).../msg03384.html:0