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

Function test_decimal_offset

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

Source from the content-addressed store, hash-verified

55#[test]
56#[cfg(not(feature = "force_validate"))]
57fn test_decimal_offset() {
58 let decimal_array = create_decimal_array(vec![Some(1), Some(2), None, Some(3)], 10, 3);
59 let decimal_array = decimal_array.slice(1, 3).into_data(); // 2, null, 3
60 let arrays = vec![&decimal_array];
61 let mut a = MutableArrayData::new(arrays, true, 2);
62 a.extend(0, 0, 2); // 2, null
63 let result = a.freeze();
64 let array = Decimal128Array::from(result);
65 let expected = create_decimal_array(vec![Some(2), None], 10, 3);
66 assert_eq!(array, expected);
67}
68
69#[test]
70#[cfg(not(feature = "force_validate"))]

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected