Run the test by evaluating the predicate on the test files with and without pruning enable
(&self)
| 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] { |
no test coverage detected