When compared to the jdbc implementation, which works for me using the
EnumerableConvention.
I see the difference is that the EnumerableProject gets mapped to a
CalcProject.
Mapped to Project.NONE
https://github.com/apache/calcite/blob/75511b82ab13ff95bc65f6180d40cf1e234b834e/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L1061
Then to CalcProject
https://github.com/apache/calcite/blob/75511b82ab13ff95bc65f6180d40cf1e234b834e/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java#L1065

That sounds like this rule: CoreRules.PROJECT_TO_CALC
But, I don't see this getting applied as such.

Thank you again,
Eric

On Sun, Jan 28, 2024 at 12:35 PM Eric Berryman <[email protected]>
wrote:

> I was trying some examples, the first being the EndToEndExampleBindable:
>
> https://github.com/zabetak/calcite/blob/demo-january-2021/core/src/test/java/org/apache/calcite/examples/foodmart/java/EndToEndExampleBindable.java
>
> This worked fine for me, but when I attempted to use the pattern in
> EndToEndExampleEnumerable:
>
> https://github.com/zabetak/calcite/blob/demo-january-2021/core/src/test/java/org/apache/calcite/examples/foodmart/java/EndToEndExampleEnumerable.java
>
> I am getting the following error message:
> Suppressed: java.lang.UnsupportedOperationException: null
> at
> org.apache.calcite.adapter.enumerable.EnumerableProject.implement(EnumerableProject.java:91)
> at
> org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:114)
> ... 53 common frames omitted
>
> from the line:
> Bindable<Object[]> executablePlan = EnumerableInterpretable.toBindable(
>         new HashMap<>(),
>         null,
>         (EnumerableRel) phyPlan,
>         EnumerableRel.Prefer.ARRAY);
>
> I'm confused how the EnumerableProject implement method has this
> java.lang.UnsupportedOperationException, and what am I missing. I'm not
> quite connecting the dots on this, and how it should look.
>
> Thank you!
> Eric
>
>

Reply via email to