MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/compute/kernels/vector_nested_test.cc:142–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142TEST(TestVectorNested, ListFlattenFixedSizeList) {
143 for (auto ty : {fixed_size_list(int16(), 2), fixed_size_list(uint32(), 2)}) {
144 const auto& out_ty = checked_cast<const FixedSizeListType&>(*ty).value_type();
145 {
146 auto input = ArrayFromJSON(ty, "[[0, null], null, [2, 3], [0, 42]]");
147 auto expected = ArrayFromJSON(out_ty, "[0, null, 2, 3, 0, 42]");
148 CheckVectorUnary("list_flatten", input, expected);
149 }
150
151 {
152 // Test a chunked array
153 auto input = ChunkedArrayFromJSON(ty, {"[[0, null], null]", "[[2, 3], [0, 42]]"});
154 auto expected = ChunkedArrayFromJSON(out_ty, {"[0, null]", "[2, 3, 0, 42]"});
155 CheckVectorUnary("list_flatten", input, expected);
156
157 input = ChunkedArrayFromJSON(ty, {});
158 expected = ChunkedArrayFromJSON(out_ty, {});
159 CheckVectorUnary("list_flatten", input, expected);
160 }
161 }
162}
163
164TEST(TestVectorNested, ListFlattenFixedSizeListNulls) {
165 const auto ty = fixed_size_list(int32(), 1);

Callers

nothing calls this directly

Calls 15

fixed_size_listFunction · 0.85
ArrayFromJSONFunction · 0.85
CheckVectorUnaryFunction · 0.85
ChunkedArrayFromJSONFunction · 0.85
listFunction · 0.85
large_listFunction · 0.85
list_viewFunction · 0.85
large_list_viewFunction · 0.85
TweakValidityBitFunction · 0.85
SwapListViewFunction · 0.85
AssertDatumsEqualFunction · 0.85
SetListViewFunction · 0.85

Tested by

no test coverage detected