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

Function prune_int32_is_null

datafusion/pruning/src/pruning_predicate.rs:4254–4290  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4252
4253 #[test]
4254 fn prune_int32_is_null() {
4255 let (schema, statistics) = int32_setup();
4256
4257 // Expression "i IS NULL" when there are no null statistics,
4258 // should all be kept
4259 let expected_ret = &[true, true, true, true, true];
4260
4261 prune_with_expr(
4262 // i IS NULL, no null statistics
4263 col("i").is_null(),
4264 &schema,
4265 &statistics,
4266 expected_ret,
4267 );
4268
4269 // provide null counts for each column
4270 let statistics = statistics.with_null_counts(
4271 "i",
4272 vec![
4273 Some(0), // no nulls (don't keep)
4274 Some(1), // 1 null
4275 None, // unknown nulls
4276 None, // unknown nulls (min/max are both null too, like no stats at all)
4277 Some(0), // 0 nulls (max=null too which means no known max) (don't keep)
4278 ],
4279 );
4280
4281 let expected_ret = &[false, true, true, true, false];
4282
4283 prune_with_expr(
4284 // i IS NULL, with actual null statistics
4285 col("i").is_null(),
4286 &schema,
4287 &statistics,
4288 expected_ret,
4289 );
4290 }
4291
4292 #[test]
4293 fn prune_int32_column_is_known_all_null() {

Callers

nothing calls this directly

Calls 5

int32_setupFunction · 0.85
prune_with_exprFunction · 0.85
with_null_countsMethod · 0.80
colFunction · 0.50
is_nullMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…