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

Avatica-Go sends the same offset for the FetchRequest

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • avatica-go-5.2.0
    • avatica-go-5.3.0
    • avatica-go
    • None

    Description

      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

      msg := &message.ExecuteRequest{
      StatementHandle:    s.handle,
      ParameterValues:    s.parametersToTypedValues(args),
      FirstFrameMaxSize:  s.conn.config.frameMaxSize,
      HasParameterValues: true,
      }

      and the result set is created after

      rsets = append(rsets, &resultSet{
      columns: columns,
      done:    frame.Done,
      offset:  frame.Offset,
      data:    data,
      })

      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{

      ConnectionId: r.conn.connectionId,
      StatementId:  r.statementID,
      Offset:       resultSet.offset,
      FrameMaxSize: r.conn.config.frameMaxSize,
      })

      So, in short, I think Avatica-Go sends 2 requests with the same offset that makes Druid to fail.

      Attachments

        Issue Links

          Activity

            People

              egrs Egor Ryashin
              egrs Egor Ryashin
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 20m
                  20m