Hi Victor,

I don't understand the first bug you are trying to describe. Please try to create a unit test which shows what you are seeing which is broken.


The second does not surprise me -- I don't recall ever seeing the CLOB datatype implemented. Same for BLOB. You are very welcome to implement them.

Please track these both using JIRA.

On 4/9/18 2:08 AM, victor wrote:
To whom concerns:
      when i use the avatica driver, found two bugs:
   one bug in protobuf serialization mode:
    1.for org.apache.calcite.avatica.driver.remote.Service$CatalogsRequest,the 
response is org.apache.calcite.avatica.remote.Service$ResultSetResponse, and in 
Service$ResultSetResponse, the firstFrame is Meta$Frame(row is 
org.apache.calcite.avatica.driver.MetaImpl$MetaCatalog);
    2.for org.apache.calcite.avatica.driver.remote.Service$SchemasRequest, the 
response is org.apache.calcite.avatica.remote.Service$ResultSetResponse, and in 
Service$ResultSetResponse, the firstFrame is Meta$Frame(row is 
org.apache.calcite.jdbc.CalciteMetaImpl$CalciteMetaSchema);
     3.for org.apache.calcite.avatica.driver.remote.Service$TypeInfoRequest, 
the response is org.apache.calcite.avatica.remote.Service$ResultSetResponse, 
and in Service$ResultSetResponse, the firstFrame is Meta$Frame(row is 
org.apache.calcite.avatica.driver.MetaImpl$MetaTypeInfo);
     4.for org.apache.calcite.avatica.driver.remote.Service$TableTypesRequest, 
the response is org.apache.calcite.avatica.remote.Service$ResultSetResponse, 
and in Service$ResultSetResponse, the firstFrame is Meta$Frame(row is 
org.apache.calcite.avatica.driver.MetaImpl$MetaTableType);
    all of above four types, in org.deepdt.dmstar.driver.Meta$Frame, toProto()method 
throws new RuntimeException("Only arrays are supported") exception ,because 
MetaImpl$MetaCatalog??CalciteMetaImpl$CalciteMetaSchema?? 
MetaImpl$MetaTypeInfo??MetaImpl$MetaTableType are not instanceof Object[] or  instanceof 
Iterable:


public Common.Frame toProto() {
       Common.Frame.Builder builder = Common.Frame.newBuilder();


       builder.setDone(done).setOffset(offset);


       for (Object row : this.rows) {
         if (null == row) {
           // Does this need to be persisted for some reason?
           continue;
         }


         final Common.Row.Builder rowBuilder = Common.Row.newBuilder();
         if (row instanceof Object[]) {
           // If only Object[] was also Iterable.
           for (Object element : (Object[]) row) {
             parseColumn(rowBuilder, element);
           }
         } else if (row instanceof Iterable) {
           for (Object element : (Iterable<?>) row) {
             parseColumn(rowBuilder, element);
           }
         } else {
           // Can a "row" be a primitive? A struct? Only an Array?
           throw new RuntimeException("Only arrays are supported");
         }


         // Collect all rows
         builder.addRows(rowBuilder.build());
       }


       return builder.build();
     }



another  bug is: it does not support clob ,blob :
in json serialization mode:
      for tables have a clob or blob datatype, throws JsonMappingException: Direct self-reference leading to cycle (through reference 
chain: 
org.apache.calcite.avatica.driver.remote.Service$FetchResponse["frame"]->org.apache.calcite.avatica.driver.Meta$Frame["rows"]->java.util.ArrayList[0]->java.util.Arrays$ArrayList[1]->oracle.sql.CLOB["dbaccess"]->oracle.jdbc.driver.T4CConnection["wrapper"])
 [SQL State=00000, DB Errorcode=-1]
in protobuf serialization mode:
  for tables have a clob or blob datatype, throws Remote driver error: 
RuntimeException: Unhandled type in Frame: class oracle.sql.CLOB [SQL 
State=00000, DB Errorcode=-1]
1 statement failed.



    please confirm the above two bugs, and let me know when to fix them, thanks 
a lot.


Best regards.


Victor Lv

Reply via email to