alamb commented on code in PR #19205:
URL: https://github.com/apache/datafusion/pull/19205#discussion_r2604213172
##########
datafusion-examples/examples/relation_planner/main.rs:
##########
@@ -90,31 +85,16 @@ async fn main() -> Result<()> {
let usage = format!(
"Usage: cargo run --example {} -- [{}]",
ExampleKind::EXAMPLE_NAME,
- ExampleKind::variants().join("|")
+ ExampleKind::VARIANTS.join("|")
);
- let arg = std::env::args().nth(1).ok_or_else(|| {
- eprintln!("{usage}");
- DataFusionError::Execution("Missing argument".to_string())
- })?;
-
- if arg == "all" {
- for example in ExampleKind::ALL {
- match example {
- ExampleKind::MatchRecognize =>
match_recognize::match_recognize().await?,
- ExampleKind::PivotUnpivot =>
pivot_unpivot::pivot_unpivot().await?,
- ExampleKind::TableSample =>
table_sample::table_sample().await?,
- }
- }
- } else {
- match arg.parse::<ExampleKind>()? {
- ExampleKind::MatchRecognize =>
match_recognize::match_recognize().await?,
- ExampleKind::PivotUnpivot => pivot_unpivot::pivot_unpivot().await?,
- ExampleKind::TableSample => table_sample::table_sample().await?,
- }
- }
+ let example: ExampleKind = std::env::args()
Review Comment:
❤️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]