You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Nathan Hartwell (Jira)" <ji...@apache.org> on 2020/11/06 19:52:00 UTC

[jira] [Comment Edited] (CALCITE-4382) CompileException on table with array of struct column

    [ https://issues.apache.org/jira/browse/CALCITE-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17227595#comment-17227595 ] 

Nathan Hartwell edited comment on CALCITE-4382 at 11/6/20, 7:51 PM:
--------------------------------------------------------------------

Flatten as in change the schema because the example is not supported or change the way the schema is defined to make it work (but somehow preserve the structure)? In either case, I'm confused why the above code works if I remove column B but fails when it's there.


was (Author: njhartwell):
Flatten as in change the schema because the example is not supported or change the way the schema is defined to make it work? In either case, I'm confused why the above code works if I remove column B but fails when it's there.

> CompileException on table with array of struct column
> -----------------------------------------------------
>
>                 Key: CALCITE-4382
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4382
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Nathan Hartwell
>            Priority: Major
>         Attachments: CalciteArrayOfStructTest.java, output.txt
>
>
> Trying to query a table like this
>  
> {code:java}
> Table brokenTableWithArrayOfStructs = new EmptyTable() {
>     @Override
>     public RelDataType getRowType(RelDataTypeFactory typeFactory) {
>         return typeFactory.builder()
>                 .add("A", typeFactory.createArrayType(typeFactory.builder().add("foo", SqlTypeName.INTEGER).build(), -1))
>                 .add("B", SqlTypeName.INTEGER)
>                 .build();
>     }
> };{code}
>  
> fails; the relevant bit appears to be
> {code:java}
> Caused by: org.codehaus.commons.compiler.CompileException: Line 5, Column 59: No applicable constructor/method found for actual parameters "java.lang.Object"; candidates are: "public static org.apache.calcite.linq4j.Enumerable org.apache.calcite.linq4j.Linq4j.asEnumerable(java.lang.Iterable)", "public static org.apache.calcite.linq4j.Enumerable org.apache.calcite.linq4j.Linq4j.asEnumerable(java.lang.Object[])", "public static org.apache.calcite.linq4j.Enumerable org.apache.calcite.linq4j.Linq4j.asEnumerable(java.util.List)", "public static org.apache.calcite.linq4j.Enumerable org.apache.calcite.linq4j.Linq4j.asEnumerable(java.util.Collection)"
> {code}
> Removing column A in the example above so that the array of structs is the only column works, as does defining column B as a map of structs. Full test case and output(including full stack trace and problematic generated code) attached.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)