[
https://issues.apache.org/jira/browse/CALCITE-842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde resolved CALCITE-842.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.6.0
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/4b519b98.
> Decorrelator gets field offsets confused if fields have been trimmed
> --------------------------------------------------------------------
>
> Key: CALCITE-842
> URL: https://issues.apache.org/jira/browse/CALCITE-842
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Julian Hyde
> Fix For: 1.6.0
>
>
> Decorrelator gets field offsets confused if fields have been trimmed. The
> query
> {code}select empno from "scott".emp as e
> join "scott".dept as d using (deptno)
> where e.sal in (
> select e2.sal from "scott".emp as e2 where e2.deptno > e.deptno);
> {code} gives the stack {noformat}Caused by: java.lang.NullPointerException
> at
> org.apache.calcite.sql2rel.RelDecorrelator.createValueGenerator(RelDecorrelator.java:746)
> at
> org.apache.calcite.sql2rel.RelDecorrelator.decorrelateInputWithValueGenerator(RelDecorrelator.java:856)
> at
> org.apache.calcite.sql2rel.RelDecorrelator.decorrelateRel(RelDecorrelator.java:915)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at
> org.apache.calcite.util.ReflectUtil.invokeVisitorInternal(ReflectUtil.java:256)
> at
> org.apache.calcite.util.ReflectUtil.invokeVisitor(ReflectUtil.java:213)
> at
> org.apache.calcite.util.ReflectUtil$1.invokeVisitor(ReflectUtil.java:476)
> at
> org.apache.calcite.sql2rel.RelDecorrelator$DecorrelateRelVisitor.visit(RelDecorrelator.java:1434)
> {noformat}
> The workaround is to disable trimming in SqlToRelConverter and do it only
> after sub-queries have been expanded and de-correlated. Search for references
> to this bug number introduced in the fix to CALCITE-816.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)