You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Aleksey Stavrov (Jira)" <ji...@apache.org> on 2021/12/15 17:57:00 UTC

[jira] [Comment Edited] (CALCITE-4900) NullPointerException when send ExectuteRequest via protobuf with no parameters

    [ https://issues.apache.org/jira/browse/CALCITE-4900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17460137#comment-17460137 ] 

Aleksey Stavrov edited comment on CALCITE-4900 at 12/15/21, 5:56 PM:
---------------------------------------------------------------------

What needs to be done to get this topic started? 

At the moment, we found that this bug affects performance because the perl DBI has such an interface that it is impossible to determine in advance whether the execute request will have parameters or not. 

I decided to give a simple pseudocode example to make it very clear what is not working via protobuf:
{noformat}
params = []; # no parameters
statement = prepare('select 1'); # simple request select 1
execute(statement, params); 
{noformat}


was (Author: logioniz):
What needs to be done to get this topic started? 

At the moment, we found that this bug affects performance because the perl DBI has such an interface that it is impossible to determine in advance whether the execute request will have parameters or not. 


> NullPointerException when send ExectuteRequest via protobuf with no parameters
> ------------------------------------------------------------------------------
>
>                 Key: CALCITE-4900
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4900
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica, jdbc-driver
>    Affects Versions: avatica-1.18.0, avatica-1.19.0, avatica-1.20.0
>            Reporter: Aleksey Stavrov
>            Priority: Critical
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This question came from this [issue|https://issues.apache.org/jira/browse/PHOENIX-6602].
> I have problem with avatica protobuf protocol with message ExecuteRequest:
> {noformat}
> 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;
> }
> {noformat}
> 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:
> {noformat}
> '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
> }
> {noformat}
> 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|https://github.com/apache/phoenix-queryserver/blob/6.0.0/pom.xml#L88]).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)