-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(flight): add sql-info helpers #4266
Conversation
arrow-flight/src/sql/sql_info.rs
Outdated
pub fn flight_info( | ||
ticket: Option<Ticket>, | ||
flight_descriptor: Option<FlightDescriptor>, | ||
) -> FlightInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I have the most doubts if this is going a bit too far? On one hand the logic should mostly be static if one implements "vanilla" flight-sql, but if still wanted to keep the option to adjust the ticket and descriptor to ones liking. with that flexibility, there is an argument though to just include it in the example server, and stick to just exposing the schema
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the reason you are including this function because it is somewhat challenging to create a FlightInfo
(especially the magic dance to encode the schema).
I wonder if we could get a similar effect by adding some builder style structures to FlightInfo, so constructing one could look like:
let flight_info = FlightInfoBuilder::new()
.with_schema(schema),
.with_ticket(ticket)
.build()
That might help other people work with these structures and we could avoid this specific API.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #4281 to track the idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great idea - should I remove this here then, or should we just go-ahead with the PR you build on top of this in include this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this PR, I recommend we move flight_info
out of SqlInfoBuilder
and into the callsite(s) where it is needed.
I hope to bash out the FlightInfoBuilder later today or over the weekend and can update the callsites then
Thank you for your help with this
Thanks @roeap ! I plan to give this a look and review tomorrow morning! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @roeap -- this looks very nice (though of course I am biased) -- sorry for the delay in review.
arrow-flight/src/sql/sql_info.rs
Outdated
pub fn flight_info( | ||
ticket: Option<Ticket>, | ||
flight_descriptor: Option<FlightDescriptor>, | ||
) -> FlightInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the reason you are including this function because it is somewhat challenging to create a FlightInfo
(especially the magic dance to encode the schema).
I wonder if we could get a similar effect by adding some builder style structures to FlightInfo, so constructing one could look like:
let flight_info = FlightInfoBuilder::new()
.with_schema(schema),
.with_ticket(ticket)
.build()
That might help other people work with these structures and we could avoid this specific API.
What do you think?
Co-authored-by: Andrew Lamb <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @roeap -- this looks awesome!
Which issue does this PR close?
Closes #4256
Rationale for this change
see #4256
What changes are included in this PR?
@alamb, here a first draft of how it might look like with
SqlInfoList
et al. an feedback if this is going in the right direction is highly appreciated.Are there any user-facing changes?
Users can now use
SqlInfoList
to easily implement flight sql methods related to communicating server capabilities.