refactor: Only pass along the one relevant config field

pull/24376/head
Carol (Nichols || Goulding) 2022-09-23 13:16:00 -04:00
parent 03940d0750
commit 2c70cd0cd0
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
1 changed files with 9 additions and 4 deletions

View File

@ -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<T, E = Error> = std::result::Result<T, E>;
async fn write_data_generation_spec(
file_id: usize,
object_store: Arc<DynObjectStore>,
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