Merged
Conversation
alamb
approved these changes
May 9, 2024
| Ok(Response::new(Box::pin(stream))) | ||
| } | ||
|
|
||
| async fn get_flight_info_statement( |
Contributor
There was a problem hiding this comment.
removing this code means it falls back to the default implementation (which also returns Not implemented)
Seems like a nice change to me 👍
| Err(Status::unimplemented("Implement get_flight_info_schemas")) | ||
| } | ||
|
|
||
| async fn get_flight_info_tables( |
| let fetch = FetchResults { handle: uuid }; | ||
| let buf = fetch.as_any().encode_to_vec().into(); | ||
| let ticket = Ticket { ticket: buf }; | ||
| let endpoint = FlightEndpoint { |
Contributor
There was a problem hiding this comment.
Nice! I think you can make this code simpler using FlightInfo::new() as shown on the examples in https://docs.rs/arrow-flight/latest/arrow_flight/struct.FlightInfo.html
// Create a new FlightInfo
let flight_info = FlightInfo::new()
// Encode the Arrow schema
.try_with_schema(&schema))
.expect("encoding failed")
.with_endpoint(
FlightEndpoint::new()
.with_ticket(ticket)
)
)
.with_descriptor(FlightDescriptor::new_cmd(Default::default()));
Member
Author
There was a problem hiding this comment.
Thanks for the suggestion!
.with_descriptor(FlightDescriptor::new_cmd(Default::default())) can not be compiled due to
cannot infer type for type parameter `impl Into<Bytes>` declared on the associated function `new_cmd`
So I changed to
let info = FlightInfo::new()
// Encode the Arrow schema
.try_with_schema(&schema)
.expect("encoding failed")
.with_endpoint(FlightEndpoint::new().with_ticket(ticket))
.with_descriptor(FlightDescriptor {
r#type: DescriptorType::Cmd.into(),
cmd: Default::default(),
path: vec![],
});
alamb
approved these changes
May 10, 2024
| Err(Status::unimplemented( | ||
| "Implement do_put_prepared_statement_query", | ||
| )) | ||
| let info = FlightInfo::new() |
findepi
pushed a commit
to findepi/datafusion
that referenced
this pull request
Jul 16, 2024
* Implement get_flight_info_tables * remove unimplemented methods * Simplify FlightInfo construction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Implement
get_flight_info_tablesand remove unimplemented methods.Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?