Hi Zoltan,

+1 on what Julian said.

Interpreter is not 100% accurate in this case since as you probably
realized this part of the code generates and compiles code.
Other than that I confirm that the Interpreter is not able to handle
correlations at the moment.

Best,
Stamatis

On Thu, Nov 7, 2019 at 11:08 PM Julian Hyde <jhyde.apa...@gmail.com> wrote:

> I don’t recall what the interpreter is currently capable of, but you
> should log a bug.
>
> I wonder whether if you could get the query to work in the interpreter if
> you decorrelated the query first.
>
> Julian
>
> > On Nov 7, 2019, at 11:16, Zoltan Farkas <zolyfar...@yahoo.com.invalid>
> wrote:
> >
> > for a test query with the following plan:
> >
> > LogicalProject(name=[$1], friends=[$4])
> >  LogicalCorrelate(correlation=[$cor0], joinType=[inner],
> requiredColumns=[{0}])
> >    LogicalTableScan(table=[[characters]])
> >    Collect(field=[EXPR$0])
> >      LogicalProject(name=[$2])
> >        LogicalJoin(condition=[=($0, $1)], joinType=[inner])
> >          LogicalProject(characterId2=[$1])
> >            LogicalFilter(condition=[=($0, $cor0.characterId)])
> >             LogicalTableScan(table=[[friendships]])
> >          LogicalProject(characterId=[$0], name=[$1])
> >            LogicalTableScan(table=[[characters]])
> >
> > I get :
> >
> > java.lang.nsupportedOperationException
> >    at
> o.a.c.i.JaninoRexCompiler.lambda$compile$0(JaninoRexCompiler.java:94)[calcite-core-1.21.0.jar:1.21.0]
> >    at
> o.a.c.a.e.RexToLixTranslator.translate0(RexToLixTranslator.java:714)[^]
> >    at ^.translate(^:199)[^]
> >    at ^.translate0(^:684)[^]
> >    at ^.translate(^:199)[^]
> >    at ^.translate(^:194)[^]
> >    ...
> >
> > when trying to use the Interpreter.
> >
> > Is this a current limitation?
> >
> > the query is :
> >
> > select name,
> >          ARRAY(select c2.name from friendships f, characters c2
> >                             where f.characterId1 = c.characterId and
> f.characterId2 = c2.characterId) as friends
> > from characters c
> >
> > let me know
> >
> > thank you
> >
> > —Z
>

Reply via email to