From 2c70cd0cd0652bc30dfb035da41c64926c16aab8 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Fri, 23 Sep 2022 13:16:00 -0400 Subject: [PATCH] refactor: Only pass along the one relevant config field --- influxdb_iox/src/commands/compactor/generate.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/influxdb_iox/src/commands/compactor/generate.rs b/influxdb_iox/src/commands/compactor/generate.rs index ec7be2f365..4307496f1f 100644 --- a/influxdb_iox/src/commands/compactor/generate.rs +++ b/influxdb_iox/src/commands/compactor/generate.rs @@ -109,8 +109,13 @@ pub async fn run(config: Config) -> Result<()> { let spec_in_root = root_dir.join(&spec_location); for file_id in 0..config.num_files.get() { - write_data_generation_spec(file_id, Arc::clone(&object_store), &config, &spec_location) - .await?; + write_data_generation_spec( + file_id, + Arc::clone(&object_store), + config.num_columns.get(), + &spec_location, + ) + .await?; generate_data(&spec_in_root, &lp_dir)?; } @@ -152,13 +157,13 @@ pub type Result = std::result::Result; async fn write_data_generation_spec( file_id: usize, object_store: Arc, - config: &Config, + num_columns: usize, spec_location: &str, ) -> Result<()> { let object_store_spec_path = object_store::path::Path::parse(spec_location).context(ObjectStorePathParsingSnafu)?; - let contents = data_generation_spec_contents(file_id, 1, config.num_columns.get()); + let contents = data_generation_spec_contents(file_id, 1, num_columns); let data = Bytes::from(contents); object_store