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

Function MakeListValuesConverter

r/src/array_to_vector.cpp:1095–1108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1093// the whole column rather than once per list element (GH-50514, GH-50339)
1094template <typename ListArrayType>
1095std::shared_ptr<Converter> MakeListValuesConverter(
1096 const std::shared_ptr<ChunkedArray>& chunked_array,
1097 const std::shared_ptr<arrow::DataType>& value_type) {
1098 ArrayVector values;
1099 values.reserve(chunked_array->num_chunks());
1100 for (const auto& chunk : chunked_array->chunks()) {
1101 // Flatten() rather than values() so that only the values that are logically
1102 // part of the list (respecting the offset of a sliced array and null lists)
1103 // take part in the decisions
1104 values.push_back(ValueOrStop(
1105 checked_cast<const ListArrayType&>(*chunk).Flatten(gc_memory_pool())));
1106 }
1107 return Converter::Make(std::make_shared<ChunkedArray>(std::move(values), value_type));
1108}
1109
1110template <typename ListArrayType>
1111class Converter_List : public Converter {

Callers

nothing calls this directly

Calls 8

ValueOrStopFunction · 0.85
gc_memory_poolFunction · 0.85
push_backMethod · 0.80
MakeFunction · 0.50
reserveMethod · 0.45
num_chunksMethod · 0.45
chunksMethod · 0.45
FlattenMethod · 0.45

Tested by

no test coverage detected