Move datafusion-cli main_inner impl into the datafusion-cli lib.#23387
Open
ratmice wants to merge 2 commits into
Open
Move datafusion-cli main_inner impl into the datafusion-cli lib.#23387ratmice wants to merge 2 commits into
ratmice wants to merge 2 commits into
Conversation
Unformatted to ease review. This also adds an example of reusing the main datafusion-cli while registering custom udf.
Author
|
Hmm, I'm uncertain how to make this patch look nice in the github review UI. It looks okay in my local git history viewer, but afaict github really wants to display them squashed? |
Author
|
After sleeping on it, there are definitely a few things this patch could do better.
|
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?
Closes #23386.
Rationale for this change
Customizing datafusion-cli with custom udf or calling
register_*currently requires copying all ofmain.rs,then dealing with the workspace dependencies required to build it, and change it to link against the
datafusion-clilibrary.If one just wants an example cli without much hassle and maintenance, it is a bit much when you hope to just add a couple lines.
What changes are included in this PR?
The first patch moves a lot of main_inner to a new struct
ClientSession, that then makes it a lot simpler.Included is an example of registering a cli-custom-udf.rs.
The second patch just reformats the code with rustfmt to deal with the addition of indentation by moving
things into an
impl CliSession.Are these changes tested?
I tested these by running the
datafusion-cliand runningselect hello(1);in the new example.Otherwise this doesn't change any existing library code.
Are there any user-facing changes?