You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Hartman, Trevor" <th...@ebay.com> on 2015/02/02 23:29:09 UTC

Re: AssertionError in RelDataTypeImpl on remote queries

Types only have a field list if they are "struct" types (i.e. are records with several named fields). Scalar types such as boolean, and other structured types such as array and map, do not have field lists.
I verified the type is ColumnMetaData.ScalarType.
I don't know how the code got to that point, but the JSON serializer seems to think it is looking at a struct type when it is actually not. If you have a repro test case can you please log a bug?
I haven't been able to create a repro test case. I tried constructing a ResultSetResponse by hand to run through the ObjectMapper, stubbing out various deps with "null", but the test continued to pass as I further specified the deps to look like mine. I wasn't able to progress past the point where attempted to create internalParameters for Meta.Signature and could not access SqlItemOperator (only accessible to classes in the same package).

Here's a snapshot from debugger of the ResultSetResponse value that causes the exception:
https://dl.dropboxusercontent.com/u/113427/response.jpg

If it helps, I tried to set up my demo project the exact same way:
https://github.com/devth/calcite-map-demo
mvn test -Dsuites=devth.calcite.TestRemoteCalcite
Strangely, it fails with a different exception:

java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.apache.calcite.sql.type.SqlTypeExplicitPrecedenceList and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: org.apache.calcite.avatica.remote.ResultSetResponse["signature"]->org.apache.calcite.avatica.Signature["internalParameters"]->java.util.LinkedHashMap["v0stashed"]->com.google.common.collect.RegularImmutableList[0]->org.apache.calcite.rex.RexCall["operands"]->com.google.common.collect.RegularImmutableList[0]->org.apache.calcite.rex.RexInputRef["type"]->org.apache.calcite.sql.type.MapSqlType["keyType"]->org.apache.calcite.sql.type.BasicSqlType["precedenceList"])
        at org.apache.calcite.avatica.remote.JsonHandler.handle(JsonHandler.java:61) ~[calcite-avatica-1.0.0-incubating.jar:1.0.0-incubating]
        at org.apache.calcite.avatica.remote.JsonHandler.apply(JsonHandler.java:46) ~[calcite-avatica-1.0.0-incubating.jar:1.0.0-incubating]
        at org.apache.calcite.avatica.server.AvaticaHandler.handle(AvaticaHandler.java:47) ~[calcite-avatica-server-1.0.0-incubating.jar:1.0.0-incubating]


Thanks,
Trevor

Re: AssertionError in RelDataTypeImpl on remote queries

Posted by Julian Hyde <ju...@hydromatic.net>.
Sure - please log a bug with a patch or pull request.

> On Feb 3, 2015, at 3:50 PM, Hartman, Trevor <th...@ebay.com> wrote:
> 
> Marking internalParameters as transient fixed the issues in both my demo repo, and my actual codebase! Could this change be committed to Calcite?
> 
> Trevor


Re: AssertionError in RelDataTypeImpl on remote queries

Posted by "Hartman, Trevor" <th...@ebay.com>.
Marking internalParameters as transient fixed the issues in both my demo repo, and my actual codebase! Could this change be committed to Calcite?

Trevor

Re: AssertionError in RelDataTypeImpl on remote queries

Posted by Vladimir Sitnikov <si...@gmail.com>.
It looks like resultSetRespense is trying to serialize internalParameters.

I bet it is not intentional.

Can you please test if preventing of 'internalParameters' serialization
solves the problem? (e.g. transient modifier)

Vladimir