File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed
Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ mimalloc_extended = ["libmimalloc-sys/extended"]
4040
4141[dependencies ]
4242arrow = { workspace = true }
43+ clap = { version = " 4.5.53" , features = [" derive" ] }
4344datafusion = { workspace = true , default-features = true }
4445datafusion-common = { workspace = true , default-features = true }
4546env_logger = { workspace = true }
@@ -54,7 +55,6 @@ regex.workspace = true
5455serde = { version = " 1.0.228" , features = [" derive" ] }
5556serde_json = { workspace = true }
5657snmalloc-rs = { version = " 0.3" , optional = true }
57- clap = { version = " 4.5.53" , features = [" derive" ] }
5858tokio = { workspace = true , features = [" rt-multi-thread" , " parking_lot" ] }
5959tokio-util = { version = " 0.7.17" }
6060
Original file line number Diff line number Diff line change @@ -34,24 +34,30 @@ static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
3434#[ global_allocator]
3535static ALLOC : mimalloc:: MiMalloc = mimalloc:: MiMalloc ;
3636
37- #[ derive( Debug , Subcommand ) ]
38- enum BenchmarkSubCommandOpt {
39- #[ command( name = "datafusion" ) ]
40- DataFusionBenchmark ( imdb:: RunOpt ) ,
41- }
42-
4337#[ derive( Debug , Parser ) ]
4438#[ command( name = "IMDB" , about = "IMDB Dataset Processing." ) ]
39+ struct Cli {
40+ #[ command( subcommand) ]
41+ command : ImdbOpt ,
42+ }
43+
44+ #[ derive( Debug , Subcommand ) ]
4545enum ImdbOpt {
4646 #[ command( subcommand) ]
4747 Benchmark ( BenchmarkSubCommandOpt ) ,
4848 Convert ( imdb:: ConvertOpt ) ,
4949}
5050
51+ #[ derive( Debug , Subcommand ) ]
52+ enum BenchmarkSubCommandOpt {
53+ #[ command( name = "datafusion" ) ]
54+ DataFusionBenchmark ( imdb:: RunOpt ) ,
55+ }
56+
5157#[ tokio:: main]
5258pub async fn main ( ) -> Result < ( ) > {
5359 env_logger:: init ( ) ;
54- match ImdbOpt :: parse ( ) {
60+ match Cli :: parse ( ) . command {
5561 ImdbOpt :: Benchmark ( BenchmarkSubCommandOpt :: DataFusionBenchmark ( opt) ) => {
5662 Box :: pin ( opt. run ( ) ) . await
5763 }
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ use datafusion_benchmarks::{
3333
3434#[ derive( Debug , Parser ) ]
3535#[ command( name = "Memory Profiling Utility" ) ]
36- struct MemProfileOpt {
36+ struct Cli {
3737 /// Cargo profile to use in dfbench (e.g. release, release-nonlto)
3838 #[ arg( long, default_value = "release" ) ]
3939 bench_profile : String ,
@@ -55,9 +55,9 @@ enum Options {
5555#[ tokio:: main]
5656pub async fn main ( ) -> Result < ( ) > {
5757 // 1. Parse args and check which benchmarks should be run
58- let mem_profile_opt = MemProfileOpt :: parse ( ) ;
59- let profile = mem_profile_opt . bench_profile ;
60- let query_range = match mem_profile_opt . command {
58+ let cli = Cli :: parse ( ) ;
59+ let profile = cli . bench_profile ;
60+ let query_range = match cli . command {
6161 Options :: Clickbench ( opt) => {
6262 let entries = std:: fs:: read_dir ( & opt. queries_path ) ?
6363 . filter_map ( Result :: ok)
You can’t perform that action at this time.
0 commit comments