You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/11/06 19:25:00 UTC
[jira] [Commented] (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=17227587#comment-17227587 ]
Julian Hyde commented on CALCITE-4382:
--------------------------------------
It's possible that you need to flatten.
> 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)