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

Method run

datafusion/core/tests/fuzz_cases/pruning.rs:165–204  ·  view source on GitHub ↗

Run the test by evaluating the predicate on the test files with and without pruning enable

(&self)

Source from the content-addressed store, hash-verified

163 /// Run the test by evaluating the predicate on the test files with and
164 /// without pruning enable
165 async fn run(&self) {
166 let ctx = SessionContext::new();
167
168 let mut predicates = vec![];
169 for value in Self::values() {
170 predicates.push((self.predicate_generator)(value));
171 }
172
173 let store = Self::memory_store();
174 ctx.register_object_store(&Url::parse("memory://").unwrap(), Arc::clone(store));
175
176 let files = Self::test_files().await;
177 let schema = Self::schema();
178 let df_schema = DFSchema::try_from(Arc::clone(&schema)).unwrap();
179
180 println!("Testing {} predicates", predicates.len());
181 for predicate in predicates {
182 // println!("Testing predicate {:?}", predicate);
183 let phys_expr_predicate = ctx
184 .create_physical_expr(predicate.clone(), &df_schema)
185 .unwrap();
186 let expected = execute_with_predicate(
187 &files,
188 Arc::clone(&phys_expr_predicate),
189 false,
190 schema.clone(),
191 &ctx,
192 )
193 .await;
194 let with_pruning = execute_with_predicate(
195 &files,
196 phys_expr_predicate,
197 true,
198 schema.clone(),
199 &ctx,
200 )
201 .await;
202 assert_eq!(expected, with_pruning);
203 }
204 }
205
206 /// all combinations of interesting characters with lengths ranging from 1 to 4
207 fn values() -> &'static [String] {

Callers 14

test_utf8_eqFunction · 0.45
test_utf8_not_eqFunction · 0.45
test_utf8_ltFunction · 0.45
test_utf8_lt_eqFunction · 0.45
test_utf8_gtFunction · 0.45
test_utf8_gt_eqFunction · 0.45
test_utf8_likeFunction · 0.45
test_utf8_not_likeFunction · 0.45
test_utf8_like_prefixFunction · 0.45
test_utf8_like_suffixFunction · 0.45

Calls 8

newFunction · 0.85
test_filesFunction · 0.85
execute_with_predicateFunction · 0.85
schemaFunction · 0.50
pushMethod · 0.45
register_object_storeMethod · 0.45
create_physical_exprMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected