Nathan Hartwell created CALCITE-4382:
----------------------------------------

             Summary: 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
         Attachments: CalciteArrayOfStructTest.java

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 
attached.



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

Reply via email to