-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The Arrow Flight SQL protocol makes use of protobuf.Any which is somewhat messy to use in Rust, meaning implementing FlightSQL clients in Rust is somewhat messy
@wangfenjin implemented a FlightSqlServer trait to assist with the server side of this in #1386. It would be nice to implement the equivalent on the client side.
Describe the solution you'd like
To make it easier for people to write flight SQL clients and servers, it would be nice if the arrow-rs crate provided a trait that handled the Any conversion.
Perhaps we can als include an flight_sql_client.cpp inspiration from @lidavidm 's https://github.com/apache/arrow/blob/master/cpp/examples/arrow/flight_sql_example.cc in the cpp implementation, as shown in wangfenjin/arrow-datafusion#1
Something like
pub struct FlightSqlClient { .. }
impl FlightSqlClient {
/// Creates a new client with the provided connection
pub fn new(channel: Connection) -> Self {
..
}
/// Do the appropriate requests of
/// `DoPut` to send `CommandStatementQuery` and then call `GetFlightInfo` to get back the stream of results
async fn query(
&mut self,
query: CommandStatementQuery,
request: FlightDescriptor,
) -> Result<SendableRecordBatchStream, Status>;
... probably other things
}Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
See server implementation here #1386