Skip to content

Conversation

@cj-zhukov
Copy link
Contributor

@cj-zhukov cj-zhukov commented Nov 2, 2025

Which issue does this PR close?

Rationale for this change

As discussed in #18289 this PR is for consolidating all the flight examples into a single example binary. Then we can make sure we are agreed on the pattern and then we can apply it to the remaining examples

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@cj-zhukov
Copy link
Contributor Author

High-Level Overview

This PR consolidates all flight examples into a single example binary.
Previously, each example had its own file, but now they can be executed via subcommands using:

cargo run --example flight -- [server|client|sql_server]

While refactoring, I also explored ways to make it simpler to extend in the future.
Specifically, I aimed to construct the available options dynamically from the ExampleKind, so new subcommands can be added in one place without needing to manually update multiple lists.

I chose not to introduce extra dependencies to keep the implementation lightweight and dependency-free, while still improving consistency and discoverability of example options.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @cj-zhukov -- I tried this out locally and it worked quite nicely:
Screenshot 2025-11-03 at 3 11 43 PM

@alamb alamb added this pull request to the merge queue Nov 4, 2025
Merged via the queue into apache:main with commit 2d5c101 Nov 4, 2025
31 checks passed
jizezhang pushed a commit to jizezhang/datafusion that referenced this pull request Nov 5, 2025
## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes apache#123` indicates that this PR will close issue apache#123.
-->

- part of #apache#18142.

## Rationale for this change
As discussed in apache#18289 this PR
is for consolidating all the `flight` examples into a single example
binary. Then we can make sure we are agreed on the pattern and then we
can apply it to the remaining examples

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

## What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

## Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->

## Are there any user-facing changes?

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->

<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->

---------

Co-authored-by: Sergey Zhukov <[email protected]>
Co-authored-by: Andrew Lamb <[email protected]>
@cj-zhukov cj-zhukov deleted the cj-zhukov/consolidate-examples-flight branch November 5, 2025 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants