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

Method Make

cpp/src/arrow/dataset/dataset.cc:453–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451 Schema* dataset_schema;
452
453 static std::unique_ptr<BasicFragmentEvolution> Make(
454 const std::shared_ptr<Schema>& dataset_schema,
455 const std::vector<std::string>& fragment_column_names) {
456 std::vector<int> ds_to_frag_map;
457 std::unordered_map<std::string, int> column_names_map;
458 for (size_t i = 0; i < fragment_column_names.size(); i++) {
459 column_names_map[fragment_column_names[i]] = static_cast<int>(i);
460 }
461 for (int idx = 0; idx < dataset_schema->num_fields(); idx++) {
462 const std::string& field_name = dataset_schema->field(idx)->name();
463 auto column_idx_itr = column_names_map.find(field_name);
464 if (column_idx_itr == column_names_map.end()) {
465 ds_to_frag_map.push_back(-1);
466 } else {
467 ds_to_frag_map.push_back(column_idx_itr->second);
468 }
469 }
470 return std::make_unique<BasicFragmentEvolution>(std::move(ds_to_frag_map),
471 dataset_schema.get());
472 }
473};
474
475class BasicDatasetEvolutionStrategy : public DatasetEvolutionStrategy {

Callers

nothing calls this directly

Calls 8

push_backMethod · 0.80
sizeMethod · 0.45
num_fieldsMethod · 0.45
nameMethod · 0.45
fieldMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected