osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avatica or Calcite or mine fault?


Hello fellow calcite dev team :)

I have discovered the case with NPE when trying to use parameters on
prepared statement:
java.lang.NullPointerException
at
org.apache.calcite.avatica.proto.Common$AvaticaParameter$Builder.setClassName(Common.java:9040)
at
org.apache.calcite.avatica.AvaticaParameter.toProto(AvaticaParameter.java:64)
at org.apache.calcite.avatica.Meta$Signature.toProto(Meta.java:835)
at org.apache.calcite.avatica.Meta$StatementHandle.toProto(Meta.java:1236)
at
org.apache.calcite.avatica.remote.Service$PrepareResponse.serialize(Service.java:1310)
at
org.apache.calcite.avatica.remote.Service$PrepareResponse.serialize(Service.java:1275)
at
org.apache.calcite.avatica.remote.ProtobufTranslationImpl.serializeResponse(ProtobufTranslationImpl.java:348)
at
org.apache.calcite.avatica.remote.ProtobufHandler.encode(ProtobufHandler.java:57)
at
org.apache.calcite.avatica.remote.ProtobufHandler.encode(ProtobufHandler.java:31)
at
org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:95)
at
org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:46)


It looks like CalcitePrepareImpl class does have one method implemented:
   private static String getClassName(RelDataType type) {
        return null;
    }
Or Common$AvaticaParameter$Builder.setClassName is too restrictive? Or
maybe AvaticaParameter.toProto() should not feed the builder with nullable
className?

Please advice, so I could help patch this.

-- 
Piotr Bojko
http://about.me/ptr.bojko