Rachelint commented on code in PR #12667: URL: https://github.com/apache/datafusion/pull/12667#discussion_r1792087233
########## datafusion/core/tests/fuzz_cases/aggregation_fuzzer/fuzzer.rs: ########## @@ -0,0 +1,266 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::sync::Arc; + +use arrow::util::pretty::pretty_format_batches; +use arrow_array::RecordBatch; +use tokio::task::JoinSet; + +use crate::fuzz_cases::aggregation_fuzzer::{ + check_equality_of_batches, + context_generator::{SessionContextGenerator, SessionContextWithParams}, + data_generator::{Dataset, DatasetGenerator, DatasetGeneratorConfig}, + run_sql, +}; + +/// Aggregation fuzzer's builder +pub struct AggregationFuzzerBuilder { + /// See `data_gen_rounds` in [`AggregationFuzzer`], default 50 + data_gen_rounds: usize, + + /// See `ctx_gen_rounds` in [`AggregationFuzzer`], default 50 + ctx_gen_rounds: usize, + + /// See `sql` in [`AggregationFuzzer`], no default, and required to set + sql: Option<Arc<str>>, + + /// See `table_name` in [`AggregationFuzzer`], no default, and required to set + table_name: Option<Arc<str>>, + + /// Used to generate `dataset_generator` in [`AggregationFuzzer`], + /// no default, and required to set + data_gen_config: Option<DatasetGeneratorConfig>, +} + +impl AggregationFuzzerBuilder { + fn new() -> Self { + Self { + data_gen_rounds: 50, + ctx_gen_rounds: 50, + sql: None, + table_name: None, + data_gen_config: None, + } + } + + #[allow(dead_code)] Review Comment: I have remove the `data_gen_rounds` and `ctx_gen_rounds`, and their related setting function. Instead, define constants `DATA_GEN_ROUNDS` and `CTX_GEN_ROUNDS` to replace, and their values are both 16. The run time seems not so long now https://github.com/apache/datafusion/pull/12667#issuecomment-2400152662 -- 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]
