We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ca0412 commit 32a2f85Copy full SHA for 32a2f85
rust/arrow/src/compute/array_ops.rs
@@ -450,4 +450,26 @@ mod tests {
450
assert_eq!(5, min(&a).unwrap());
451
assert_eq!(9, max(&a).unwrap());
452
}
453
+
454
+ #[test]
455
+ fn test_filter_array() {
456
+ let a = Int32Array::from(vec![5, 6, 7, 8, 9]);
457
+ let b = BooleanArray::from(vec![true, false, false, true, false]);
458
+ let c = filter(&a, &b).unwrap();
459
+ let d = c.as_ref().as_any().downcast_ref::<Int32Array>().unwrap();
460
+ assert_eq!(2, d.len());
461
+ assert_eq!(5, d.value(0));
462
+ assert_eq!(8, d.value(1));
463
+ }
464
465
466
+ fn test_limit_array() {
467
468
+ let c = limit(&a, 3).unwrap();
469
470
+ assert_eq!(3, d.len());
471
472
+ assert_eq!(6, d.value(1));
473
+ assert_eq!(7, d.value(2));
474
475
0 commit comments