You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When executing DoPutPreparedStatementQuery requests to bind parameters to a prepared statement, using the DoPut Flight RPC, one may receive an error like this:
rpc error: code = Internal desc = Received RecordBatch prior to Schema
This is because the implementation of FlightService for FlightSQL servers consumes the first flight batch by calling .message() on the Request<Streaming<FlightData>> handle:
It does this to inspect the type of the FlightDescriptor, which tells it which DoPut handler to dispatch to in the FlightSqlService. If the schema was encoded in the very first message together with the FlightDescriptor, calling .message() consumes both the FlightDescriptor and the schema, so that a FlightSqlService handler such as do_put_prepared_statement_query no longer can read the schema from the Request<Streaming<FlightData>>.
To Reproduce
Implement a FlightSqlService that handles any kind of DoPut request and decodes the flight stream, such as the following:
Expected behavior
The server should be able to properly handle flight streams sent from a compliant FlightSQL client.
Additional context
This bug was uncovered while implementing and testing prepared statements for a Rust FlightSQL server. The same bug was observed when submitting queries from both Rust and Go FlightSQL clients (the server is a Rust FlightSQL server).
The text was updated successfully, but these errors were encountered:
Describe the bug
When executing
DoPutPreparedStatementQuery
requests to bind parameters to a prepared statement, using theDoPut
Flight RPC, one may receive an error like this:This is because the implementation of
FlightService
for FlightSQL servers consumes the first flight batch by calling.message()
on theRequest<Streaming<FlightData>>
handle:It does this to inspect the type of the
FlightDescriptor
, which tells it whichDoPut
handler to dispatch to in theFlightSqlService
. If the schema was encoded in the very first message together with theFlightDescriptor
, calling.message()
consumes both theFlightDescriptor
and the schema, so that aFlightSqlService
handler such asdo_put_prepared_statement_query
no longer can read the schema from theRequest<Streaming<FlightData>>
.To Reproduce
Implement a
FlightSqlService
that handles any kind ofDoPut
request and decodes the flight stream, such as the following:then execute a
DoPut
using a rawdo_put
request on theFlightSqlServiceClient
, sending the following batch:Expected behavior
The server should be able to properly handle flight streams sent from a compliant FlightSQL client.
Additional context
This bug was uncovered while implementing and testing prepared statements for a Rust FlightSQL server. The same bug was observed when submitting queries from both Rust and Go FlightSQL clients (the server is a Rust FlightSQL server).
The text was updated successfully, but these errors were encountered: