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

Function test_append_values

arrow-array/src/builder/buffer_builder.rs:209–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207
208 #[test]
209 fn test_append_values() {
210 let mut a = Int8Builder::new();
211 a.append_value(1);
212 a.append_null();
213 a.append_value(-2);
214 assert_eq!(a.len(), 3);
215
216 // append values
217 let values = &[1, 2, 3, 4];
218 let is_valid = &[true, true, false, true];
219 a.append_values(values, is_valid);
220
221 assert_eq!(a.len(), 7);
222 let array = a.finish();
223 assert_eq!(array.value(0), 1);
224 assert!(array.is_null(1));
225 assert_eq!(array.value(2), -2);
226 assert_eq!(array.value(3), 1);
227 assert_eq!(array.value(4), 2);
228 assert!(array.is_null(5));
229 assert_eq!(array.value(6), 4);
230 }
231}

Callers

nothing calls this directly

Calls 4

append_valueMethod · 0.45
append_nullMethod · 0.45
append_valuesMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected