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

Method GetFieldReaders

cpp/src/parquet/arrow/reader.cc:232–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230 }
231
232 Status GetFieldReaders(const std::vector<int>& column_indices,
233 const std::vector<int>& row_groups,
234 std::vector<std::shared_ptr<ColumnReaderImpl>>* out,
235 std::shared_ptr<::arrow::Schema>* out_schema) {
236 // We only need to read schema fields which have columns indicated
237 // in the indices vector
238 ARROW_ASSIGN_OR_RAISE(std::vector<int> field_indices,
239 manifest_.GetFieldIndices(column_indices));
240
241 auto included_leaves = VectorToSharedSet(column_indices);
242
243 out->resize(field_indices.size());
244 ::arrow::FieldVector out_fields(field_indices.size());
245 for (size_t i = 0; i < out->size(); ++i) {
246 std::unique_ptr<ColumnReaderImpl> reader;
247 RETURN_NOT_OK(
248 GetFieldReader(field_indices[i], included_leaves, row_groups, &reader));
249
250 out_fields[i] = reader->field();
251 out->at(i) = std::move(reader);
252 }
253
254 *out_schema = ::arrow::schema(std::move(out_fields), manifest_.schema_metadata);
255 return Status::OK();
256 }
257
258 Status GetColumn(int i, FileColumnIteratorFactory iterator_factory,
259 std::unique_ptr<ColumnReader>* out);

Callers

nothing calls this directly

Calls 6

VectorToSharedSetFunction · 0.85
resizeMethod · 0.80
schemaFunction · 0.50
OKFunction · 0.50
sizeMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected