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

Function invalid_array_data

arrow-array/src/array/byte_view_array.rs:1812–1826  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1810 #[should_panic(expected = "invalid utf-8 sequence")]
1811 #[test]
1812 fn invalid_array_data() {
1813 let (views, buffers, nulls) = binary_view_array_with_invalid_utf8_data().into_parts();
1814
1815 // manually try and add invalid array data with Utf8View data type
1816 let mut builder = ArrayDataBuilder::new(DataType::Utf8View)
1817 .add_buffer(views.into_inner())
1818 .len(3);
1819 for buffer in buffers.iter() {
1820 builder = builder.add_buffer(buffer.clone())
1821 }
1822 builder = builder.nulls(nulls);
1823
1824 let data = builder.build().unwrap(); // should fail validation
1825 let _arr = StringViewArray::from(data);
1826 }
1827
1828 /// Returns a BinaryViewArray with one invalid UTF-8 value
1829 fn binary_view_array_with_invalid_utf8_data() -> BinaryViewArray {

Callers

nothing calls this directly

Calls 9

add_bufferMethod · 0.80
into_partsMethod · 0.45
lenMethod · 0.45
into_innerMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
nullsMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected