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

Egor Ryashin commented on CALCITE-6139:
---------------------------------------

That *println* won't help, because it fails before  
[https://github.com/apache/calcite-avatica-go/blob/main/rows.go#L111 
|https://github.com/apache/calcite-avatica-go/blob/main/rows.go#L111]

I found out that the first frame comes here: 
`go-test/vendor/github.com/apache/calcite-avatica-go/v5/connection.go:205` 

The output of
{code:java}
fmt.Println("first frame ", resultSets[0].FirstFrame.Offset, 
len(resultSets[0].FirstFrame.Rows)){code}
is
{code:java}
first frame  0 5000{code}

> Avatica-Go sends the same offset for the FetchRequest
> -----------------------------------------------------
>
>                 Key: CALCITE-6139
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6139
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica-go
>    Affects Versions: avatica-go-5.2.0
>            Reporter: Egor Ryashin
>            Assignee: Francis Chuang
>            Priority: Major
>
> This exception happens when *Apache Druid Avatica* protobuf endpoint is used: 
> {_}"Druid can only fetch forward. Requested offset”{_}.
> I tried to debug that and saw that any simple query fails if it triggers 
> fetching of multiple frames. I speculate that when the first *ExucuteRequest* 
> is sent
> {code:java}
> msg := &message.ExecuteRequest{
> StatementHandle:    s.handle,
> ParameterValues:    s.parametersToTypedValues(args),
> FirstFrameMaxSize:  s.conn.config.frameMaxSize,
> HasParameterValues: true,
> }{code}
> and the result set is created after
> {code:java}
> rsets = append(rsets, &resultSet{
> columns: columns,
> done:    frame.Done,
> offset:  frame.Offset,
> data:    data,
> }){code}
> then for the next frame *FetchRequest* is sent but it uses the same 0 offset 
> (the data for that offset was returned with the {*}ExecuteRequest{*})
> res, err := r.conn.httpClient.post(context.Background(), 
> &message.FetchRequest{
> {code:java}
> ConnectionId: r.conn.connectionId,
> StatementId:  r.statementID,
> Offset:       resultSet.offset,
> FrameMaxSize: r.conn.config.frameMaxSize,
> }){code}
> So, in short, I think *Avatica-Go* sends 2 requests with the same offset that 
> makes Druid to fail.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to