Bruno Dumon created CALCITE-913:
-----------------------------------

             Summary: Avatica: transport of array fields fails
                 Key: CALCITE-913
                 URL: https://issues.apache.org/jira/browse/CALCITE-913
             Project: Calcite
          Issue Type: Bug
            Reporter: Bruno Dumon
            Assignee: Julian Hyde


When using the avatica remote driver, reading a resultset which contains a 
non-null ARRAY-type field fails (both in json & protobuf).

This can be reproduced by adding the following test to RemoteMetaTest.java:

{noformat}
  @Test public void testArrays() throws SQLException {
    try (AvaticaConnection conn = (AvaticaConnection) 
DriverManager.getConnection(url);
         Statement stmt = conn.createStatement()) {

      ResultSet resultSet =
          stmt.executeQuery("select * from (values ('a', array['b', 'c']));");

      assertTrue(resultSet.next());
    }
  }
{noformat}

For example with json this gives the following error:

{noformat}
2015-10-07 16:09:08.406:WARN:oejs.HttpChannel:qtp1931444790-20: /
java.lang.RuntimeException: 
com.fasterxml.jackson.databind.JsonMappingException: Conflicting getter 
definitions for property "updateCount": 
org.hsqldb.result.Result#isUpdateCount(0 params) vs 
org.hsqldb.result.Result#getUpdateCount(0 params) (through reference chain: 
org.apache.calcite.avatica.remote.ExecuteResponse["results"]->java.util.ArrayList[0]->org.apache.calcite.avatica.remote.ResultSetResponse["firstFrame"]->org.apache.calcite.avatica.Frame["rows"]->java.util.ArrayList[0]->org.hsqldb.jdbc.JDBCArray["resultSet"]->org.hsqldb.jdbc.JDBCResultSet["result"])
        at 
org.apache.calcite.avatica.remote.JsonHandler.handle(JsonHandler.java:61)
        at 
org.apache.calcite.avatica.remote.JsonHandler.apply(JsonHandler.java:46)
        at 
org.apache.calcite.avatica.server.AvaticaHandler.handle(AvaticaHandler.java:66)
        at 
org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:497)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
        at 
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.lang.Thread.run(Thread.java:745)
Caused by: 
com.fasterxml.jackson.databind.JsonMappingException: Conflicting getter 
definitions for property "updateCount": 
org.hsqldb.result.Result#isUpdateCount(0 params) vs 
org.hsqldb.result.Result#getUpdateCount(0 params) (through reference chain: 
org.apache.calcite.avatica.remote.ExecuteResponse["results"]->java.util.ArrayList[0]->org.apache.calcite.avatica.remote.ResultSetResponse["firstFrame"]->org.apache.calcite.avatica.Frame["rows"]->java.util.ArrayList[0]->org.hsqldb.jdbc.JDBCArray["resultSet"]->org.hsqldb.jdbc.JDBCResultSet["result"])
        at 
com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:897)
        at 
com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:429)
...
{noformat}

The above is with hsqldb's array implementation. With another one it went into 
infinite recursion.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to