Commit cd12d51
authored
Replace deprecated structopt with clap in datafusion-benchmarks (#19492)
## Which issue does this PR close?
- Closes #19482
- (Part of #19072 )
## Rationale for this change
The structopt crate is deprecated and has been superseded by clap with
its derive feature.
This migration:
- Removes a deprecated dependency
- Potentially improves compilation times for the benchmarks crate
- Keeps the codebase up-to-date with modern Rust ecosystem practices
## What changes are included in this PR?
- Updated Cargo.toml to use clap = { version = "4.5.53", features =
["derive"] } instead of structopt
- Migrated all benchmark source files to use clap's derive macros:
- `#[derive(StructOpt)]` → `#[derive(Parser/Args/Subcommand)]`
- `#[structopt(...)]` → `#[arg(...)]` for fields
- `#[structopt(...)]` → `#[command(...)]` for struct/enum-level
attributes
- `StructOpt::from_args()` → `Parser::parse()`
- Removed `parse(from_os_str)` as PathBuf works natively in clap
- Changed short flag strings to chars ('p' instead of "p")
## Are these changes tested?
Yes
## Are there any user-facing changes?
No. The CLI interface remains identical - this is a drop-in replacement
of the underlying argument parsing library.1 parent db7b8cc commit cd12d51
File tree
18 files changed
+196
-263
lines changed- benchmarks
- src
- bin
- imdb
- tpcds
- tpch
- util
18 files changed
+196
-263
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
0 commit comments