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

Method GetFieldReaders

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

Source from the content-addressed store, hash-verified

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