Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4900

NullPointerException when send ExectuteRequest via protobuf with no parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • avatica-1.18.0, avatica-1.19.0, avatica-1.20.0
    • avatica-1.23.0
    • avatica, jdbc-driver
    • None

    Description

      This question came from this issue.

      I have problem with avatica protobuf protocol with message ExecuteRequest:

      message ExecuteRequest {
        StatementHandle statementHandle = 1;
        repeated TypedValue parameter_values = 2;
        uint64 deprecated_first_frame_max_size = 3;
        bool has_parameter_values = 4;
        int32 first_frame_max_size = 5;
      }
      

      I try to use prepare and execute without bind parameters. So, i set has_parameter_values to false and don't specify parameter_values and i get exception:

      'protocol' => {
              'severity' => 0,
              'exceptions' => [
                                      'java.lang.NullPointerException
      	at org.apache.calcite.avatica.MetaImpl.checkParameterValueHasNull(MetaImpl.java:1633)
      	at org.apache.calcite.avatica.jdbc.JdbcMeta.execute(JdbcMeta.java:849)
      	at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:260)
      	at org.apache.calcite.avatica.remote.Service$ExecuteRequest.accept(Service.java:1056)
      	at org.apache.calcite.avatica.remote.Service$ExecuteRequest.accept(Service.java:1026)
      	at org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:94)
      	at org.apache.calcite.avatica.remote.ProtobufHandler.apply(ProtobufHandler.java:46)
      	at org.apache.calcite.avatica.server.AvaticaProtobufHandler.handle(AvaticaProtobufHandler.java:134)
      	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      	at org.eclipse.jetty.server.Server.handle(Server.java:501)
      	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
      	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
      	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
      	at java.lang.Thread.run(Thread.java:748)
      '],
          'message' => 'NullPointerException: (null exception message)',
          'sql_state' => '00000',
          'error_code' => 4294967295
      }
      

      I believe this is a bug because there is a parameter has_parameter_values which denotes that parameter_values can be an empty list.

      I use phoenix-queryserver-6.0.0 and i don't know the version of avatica (may be 1.18 according to that link).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              logioniz Aleksey Stavrov
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m