MCPcopy Create free account
hub / github.com/apache/datafusion / test_first_val

Function test_first_val

datafusion/core/tests/fuzz_cases/aggregate_fuzz.rs:97–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95
96#[tokio::test(flavor = "multi_thread")]
97async fn test_first_val() {
98 let mut data_gen_config: DatasetGeneratorConfig = baseline_config();
99
100 for i in 0..data_gen_config.columns.len() {
101 if data_gen_config.columns[i].get_max_num_distinct().is_none() {
102 data_gen_config.columns[i] = data_gen_config.columns[i]
103 .clone()
104 // Minimize the chance of identical values in the order by columns to make the test more stable
105 .with_max_num_distinct(usize::MAX);
106 }
107 }
108
109 let query_builder = QueryBuilder::new()
110 .with_table_name("fuzz_table")
111 .with_aggregate_function("first_value")
112 .with_aggregate_arguments(data_gen_config.all_columns())
113 .with_dataset_sort_keys(data_gen_config.sort_keys_set.clone())
114 .set_group_by_columns(data_gen_config.all_columns());
115
116 AggregationFuzzerBuilder::from(data_gen_config)
117 .add_query_builder(query_builder)
118 .build()
119 .run()
120 .await;
121}
122
123#[tokio::test(flavor = "multi_thread")]
124async fn test_last_val() {

Callers

nothing calls this directly

Calls 15

baseline_configFunction · 0.85
newFunction · 0.85
is_noneMethod · 0.80
get_max_num_distinctMethod · 0.80
with_max_num_distinctMethod · 0.80
set_group_by_columnsMethod · 0.80
with_table_nameMethod · 0.80
all_columnsMethod · 0.80
add_query_builderMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…