-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add optional flag which advertises host for Arrow Flight SQL #418 #442
Conversation
I've validated my changes have the expected outcome by writing a test in the flight portion of the arrow repo.
Running this test in conjunction with a local scheduler (having passing it |
I'm actually a little surprised that query returns a flight since it is DML. @andygrove I think we'll want to merge this PR because we presently rely on a bug in the FlightSQL JDBC driver where Ballista only works because it always re-uses the connection to the scheduler. This PR should make it work even after that issue is fixed. |
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'd say the unwraps and unsafe array indexing need resolution. The others are just nits.
Nice job! 🥳
ballista/scheduler/src/flight_sql.rs
Outdated
.server | ||
.advertise_host | ||
.as_ref() | ||
.unwrap() |
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 think we want to avoid unwrap()
s as a rule, but especially in functions that already return Result
s...
ballista/scheduler/src/flight_sql.rs
Outdated
.unwrap() | ||
.split(":") | ||
.collect(); | ||
(advertise_host_flag[0].to_string(), advertise_host_flag[1].parse().unwrap()) |
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.
Same... I think there is a safe way to index into the array: https://adventures.michaelfbryan.com/posts/daily/slice-patterns/
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.
Sorry, accidentally marked it approve. I'd like to see the unwraps fixed.
Approach LGTM. Agree on the unwraps. I would like to test this out as well before approving. I'll try and get that to that today. |
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.
LGTM. Thanks @DaltonModlin!
Some(endpoint) => { | ||
let advertise_endpoint_vec: Vec<&str> = endpoint.split(":").collect(); | ||
match advertise_endpoint_vec.as_slice() { | ||
[host_ip, port] => { |
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.
❤️
@DaltonModlin There is a clippy failure .. I will merge once that is resolved |
It looks like clippy is worried because there are 8 argument to the function |
58fdd34
to
f0d1f5b
Compare
@DaltonModlin Looks like there is conflict? |
f0d1f5b
to
4d93ed7
Compare
- Update scheduler_config_spec.toml to include new flag 'advertise_host' - Add advertise_host member variable to SchedulerServer - Add advertise_host argument to new, new_with_policy, new_with_builder, and new_with_state in order to propagate flag - Add None argument to relevant method calls Add optional flag which advertises host for Arrow Flight SQL apache#418 - Update logic in job_to_fetch_part to use advertise-host flag when it exists - Remove default from advertise_host in scheduler_config_spec.toml - Wrap scheduler_server advertise_host variable in Option - Update scheduler's main.rs to reflect advertise_host being wrapped in Option Utilize executor IP for routing to flight results in job_to_fetch_part even when advertise-host flag is set. Add missing variable and ownership stuff Remove unnecessary output from do_get_fallback Responding to PR feedback - Rename advertise-host to advertise-endpoint - Replace unwrap calls with expect where possible - Add missing error handling when parsing advertise-endpoint flag PR feedback Co-authored-by: Andy Grove <[email protected]> PR Feedback - Using slice rather than array indexing for parsing advertise-endpoint PR Feedback - Fix clippy issue Fix pipeline failure
4d93ed7
to
4456e02
Compare
Add optional flag which advertises host for Arrow Flight SQL #418
Utilize executor IP for routing to flight results in job_to_fetch_part even when advertise-host flag is set.
Add missing variable and ownership stuff
Remove unnecessary output from do_get_fallback
Which issue does this PR close?
Closes #418
Rationale for this change
What changes are included in this PR?
Adds member variable to SchedulerServer, adds argument to relevant constructors as necessary.
Are there any user-facing changes?
Adds advertise-host flag for proxying via scheduler as described in original issue.