Skip to content
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

Allow overriding of do_get & export useful macro #2582

Merged
merged 4 commits into from Aug 25, 2022

Conversation

avantgardnerio
Copy link
Contributor

Which issue does this PR close?

Closes #2581.

Rationale for this change

Described in the issue.

What changes are included in this PR?

Allowing implementers to override do_get and exporting a useful protobuf macro.

Are there any user-facing changes?

This will empower them to do more, but change no behavior by default.

@@ -301,92 +312,91 @@ where
&self,
request: Request<FlightDescriptor>,
) -> Result<Response<FlightInfo>, Status> {
let any: prost_types::Any =
let message: prost_types::Any =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More descriptive name.

@avantgardnerio
Copy link
Contributor Author

CC @thinkharderdev

@github-actions github-actions bot added the arrow-flight Changes to the arrow-flight crate label Aug 24, 2022
@@ -61,6 +61,18 @@ pub trait FlightSqlService:
))
}

/// Implementors may override to handle additional calls to do_get()
async fn custom_do_get(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the real change

"do_get: The defined request is invalid: {:?}",
String::from_utf8(request.get_ref().ticket.clone()).unwrap()
)))
self.custom_do_get(request, msg).await
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main purpose of the PR

@avantgardnerio
Copy link
Contributor Author

oh @alamb might be interested since it's arrow

@tustvold
Copy link
Contributor

I'm not sure I understand this PR, the issue talks about request proxying which seems unrelated to the changes here?

@avantgardnerio
Copy link
Contributor Author

I'm not sure I understand this PR

I should have done a better job at separating my particular use-case from the idea of extensibility as a concept.

In this PR, I would like to make the do_get() handler overridable like previous PRs have done with things like passing up the raw tonic context so implementers can use it how they see fit.

The main driver of these arrow-rs PRs has been our ongoing efforts to add FlightSQL support (and therefor JDBC support) to Ballista. The particular reason I'd like to override do_get is to extend it to allow the FlightSQL server to also serve Flights. Specifically, I'd like to make it capable of proxying flights to executors.

But this PR is just about making it extensible in general. I think the correct place for the discussion would probably be on a Ballista PR, but unfortunately I can't publish a working one until these arrow changes are released and DataFusion upgrades to them.

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would call the method do_get_fallback to be more consistent, but otherwise this seems reasonable to me

arrow-flight/src/sql/server.rs Outdated Show resolved Hide resolved
arrow-flight/src/sql/mod.rs Outdated Show resolved Hide resolved
@avantgardnerio
Copy link
Contributor Author

avantgardnerio commented Aug 25, 2022

exporting macros makes me very uncomfortable

Yes, you're probably right. I think I can achieve the same thing in Ballista without much extra effort if I don't export. I'll back that out. At minimum, it should be done in a another PR with more consideration than "well, that's handy".

@tustvold tustvold merged commit a685c5f into apache:master Aug 25, 2022
@ursabot
Copy link

ursabot commented Aug 25, 2022

Benchmark runs are scheduled for baseline = c692b25 and contender = a685c5f. a685c5f is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@avantgardnerio avantgardnerio deleted the bg_proxy_pr branch August 25, 2022 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow-flight Changes to the arrow-flight crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow FlightSQL implementers to extend do_get()
3 participants