MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_nullif_int_array

Function test_nullif_int_array

arrow-select/src/nullif.rs:127–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125
126 #[test]
127 fn test_nullif_int_array() {
128 let a = Int32Array::from(vec![Some(15), None, Some(8), Some(1), Some(9)]);
129 let comp = BooleanArray::from(vec![Some(false), None, Some(true), Some(false), None]);
130 let res = nullif(&a, &comp).unwrap();
131
132 let expected = Int32Array::from(vec![
133 Some(15),
134 None,
135 None, // comp true, slot 2 turned into null
136 Some(1),
137 // Even though comp array / right is null, should still pass through original value
138 // comp true, slot 2 turned into null
139 Some(9),
140 ]);
141
142 let res = res.as_primitive::<Int32Type>();
143 assert_eq!(&expected, res);
144 }
145
146 #[test]
147 fn test_nullif_null_array() {

Callers

nothing calls this directly

Calls 1

nullifFunction · 0.85

Tested by

no test coverage detected