Yuvraj-cyborg opened a new issue, #19482:
URL: https://github.com/apache/datafusion/issues/19482

   ## Is your feature request related to a problem or challenge?
   The benchmarks crate (datafusion-benchmarks) uses structopt for CLI argument 
parsing, which has been deprecated since 2021. The structopt README explicitly 
states:
   
   > As of clap v3, structopt is now part of clap. Instead of using structopt, 
use clap directly.
   
   structopt has not been updated in years and adds unnecessary compile-time 
overhead compared to modern clap derive macros.
   
   This is part of the larger effort to improve benchmark compilation times 
(#19072 ).
   
   ## Describe the solution you'd like
   Replace structopt with clap (version 4.x) in the benchmarks crate:
   
   Update Cargo.toml:
   
   ```toml
   - structopt = { version = "0.3", default-features = false }
   + clap = { version = "4", features = ["derive"] }
   ```
   
   Update all benchmark source files to use clap instead of structopt:
   
   - Change use structopt::StructOpt → use clap::Parser
   - Change #[derive(StructOpt)] → #[derive(Parser)]
   - Change #[structopt(...)] → #[arg(...)] or #[command(...)]
   - Change StructOpt::from_args() → Parser::parse()
   
   Files to update:
   
   - dfbench.rs
   - run.rs
   - clickbench.rs
   - h2o.rs
   - run.rs
   - cancellation.rs
   - sort_tpch.rs
   - hj.rs
   - nlj.rs
   - Any other files using structopt
   
   ## Describe alternatives you've considered
   - Keep using structopt (Not recommended as it's deprecated and unmaintained)
   
   ## Additional context
   - Migration guide from structopt to clap: 
https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#migrating
   
   Common attribute changes:
   
   | `structopt`                         | `clap`                              |
   |-------------------------------------|-------------------------------------|
   | `#[structopt(subcommand)]`           | `#[command(subcommand)]`            
|
   | `#[structopt(long, short)]`          | `#[arg(long, short)]`               
|
   | `#[structopt(about = "...")]`        | `#[command(about = "...")]`         
|
   | `#[structopt(name = "...")]`         | `#[command(name = "...")]`          
|
   | `#[structopt(default_value = "...")]`| `#[arg(default_value = "...")]`     
|
   
   Related to #19072 (Benchmarks binary compilation takes too long)


-- 
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]

Reply via email to