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

Method DevolveSelection

cpp/src/arrow/dataset/dataset.cc:368–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366 }
367
368 Result<std::unique_ptr<FragmentSelection>> DevolveSelection(
369 const std::vector<FieldPath>& dataset_schema_selection) const override {
370 std::vector<FragmentSelectionColumn> desired_columns;
371 std::vector<MissingColumn> missing_columns;
372 for (std::size_t selection_idx = 0; selection_idx < dataset_schema_selection.size();
373 selection_idx++) {
374 const FieldPath& path = dataset_schema_selection[selection_idx];
375 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Field> field, path.Get(*dataset_schema));
376 int top_level_field_idx = path[0];
377 int dest_top_level_idx = ds_to_frag_map[top_level_field_idx];
378 if (dest_top_level_idx >= 0) {
379 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Field> field, path.Get(*dataset_schema));
380 std::vector<int> dest_path_indices(path.indices());
381 dest_path_indices[0] = dest_top_level_idx;
382 desired_columns.push_back(
383 FragmentSelectionColumn{FieldPath(dest_path_indices), field->type().get()});
384 } else {
385 missing_columns.push_back({selection_idx, field->type()});
386 }
387 }
388 return std::make_unique<BasicFragmentSelection>(std::move(desired_columns),
389 std::move(missing_columns));
390 };
391
392 Result<compute::Expression> DevolveFilter(
393 const compute::Expression& filter) const override {

Callers 2

TESTFunction · 0.80

Calls 8

FieldPathFunction · 0.85
indicesMethod · 0.80
push_backMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
sizeMethod · 0.45
GetMethod · 0.45
getMethod · 0.45
typeMethod · 0.45

Tested by 1

TESTFunction · 0.64