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

Function test_decimal_null_offset_nulls

arrow/tests/array_transform.rs:71–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69#[test]
70#[cfg(not(feature = "force_validate"))]
71fn test_decimal_null_offset_nulls() {
72 let decimal_array = create_decimal_array(vec![Some(1), Some(2), None, Some(3)], 10, 3);
73 let decimal_array = decimal_array.slice(1, 3).into_data(); // 2, null, 3
74 let arrays = vec![&decimal_array];
75 let mut a = MutableArrayData::new(arrays, true, 2);
76 a.extend(0, 0, 2); // 2, null
77 a.extend_nulls(3); // 2, null, null, null, null
78 a.extend(0, 1, 3); //2, null, null, null, null, null, 3
79 let result = a.freeze();
80 let array = Decimal128Array::from(result);
81 let expected =
82 create_decimal_array(vec![Some(2), None, None, None, None, None, Some(3)], 10, 3);
83 assert_eq!(array, expected);
84}
85
86/// tests extending from a primitive array w/ offset nor nulls
87#[test]

Callers

nothing calls this directly

Calls 6

extend_nullsMethod · 0.80
freezeMethod · 0.80
create_decimal_arrayFunction · 0.70
into_dataMethod · 0.45
sliceMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected