-
Notifications
You must be signed in to change notification settings - Fork 839
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: simple flight sql CLI client #3789
feat: simple flight sql CLI client #3789
Conversation
0fa0d66
to
10cdfb0
Compare
934aa51
to
75403f0
Compare
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.
Looks good to me, just some minor questions about the protocol really
(None, None) => {} | ||
(Some(username), Some(password)) => { | ||
client | ||
.handshake(&username, &password) |
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.
What is the purpose of this if nothing is done with the response?
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.
If the user does not provide the token, the handshake message may contain it (see impl. of the handshake
method). So the username+password is exchanged for a token which is then used in subsequent requests. The token is a state of the client object. I think for many applications that will work just fine (it doesn't for InfluxDB cloud at the moment, there you pass the token manually into the CLI; just to be transparent).
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.
Oh, I didn't realise that handshake
modified the client with the received token. Makes sense, somewhat questionable API but 👍
@@ -41,6 +41,12 @@ prost-derive = { version = "0.11", default-features = false } | |||
tokio = { version = "1.0", default-features = false, features = ["macros", "rt", "rt-multi-thread"] } | |||
futures = { version = "0.3", default-features = false, features = ["alloc"] } | |||
|
|||
# CLI-related dependencies | |||
arrow = { version = "34.0.0", path = "../arrow", optional = true } |
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.
This is kind of unfortunate, even as an optional dependency... Perhaps we should move the pretty printing into arrow-cast 🤔
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'm open to that.
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'll see what I can do as a follow up
75403f0
to
37ff6c5
Compare
Benchmark runs are scheduled for baseline = 2f54ae9 and contender = 7f460af. 7f460af is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
-
Rationale for this change
It's a bit of a pity that the Rust ecosystem has a flight SQL client, async runtimes, logging, and a nice CLI parser but we don't have an easy-to-use oneshot flight SQL client and require people to write code or use Java executables just to try out Flight SQL. Here is a simple CLI client that wires up everything end2end. It currently only perform as simple "execute query" but people may want to extend it in the future.
What changes are included in this PR?
I simple CLI client.
Are there any user-facing changes?
New optional binary.
Small demo (using InfluxDB cloud):