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

Function SetOutputColumns

cpp/src/arrow/acero/tpch_node.cc:563–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563Result<std::shared_ptr<Schema>> SetOutputColumns(
564 const std::vector<std::string>& columns,
565 const std::vector<std::shared_ptr<DataType>>& types,
566 const std::unordered_map<std::string, int>& name_map, std::vector<int>& gen_list) {
567 gen_list.clear();
568 std::vector<std::shared_ptr<Field>> fields;
569 if (columns.empty()) {
570 fields.resize(name_map.size());
571 gen_list.resize(name_map.size());
572 for (auto pair : name_map) {
573 int col_idx = pair.second;
574 fields[col_idx] = field(pair.first, types[col_idx]);
575 gen_list[col_idx] = col_idx;
576 }
577 return schema(std::move(fields));
578 } else {
579 for (const std::string& col : columns) {
580 auto entry = name_map.find(col);
581 if (entry == name_map.end()) return Status::Invalid("Not a valid column name");
582 int col_idx = static_cast<int>(entry->second);
583 fields.push_back(field(col, types[col_idx]));
584 gen_list.push_back(col_idx);
585 }
586 return schema(std::move(fields));
587 }
588}
589
590Result<Datum> RandomVString(random::pcg32_fast& rng, int64_t num_rows, int32_t min_length,
591 int32_t max_length) {

Callers 8

SetPartOutputColumnsMethod · 0.85
InitMethod · 0.85
InitMethod · 0.85
InitMethod · 0.85
InitMethod · 0.85

Calls 10

resizeMethod · 0.80
push_backMethod · 0.80
fieldFunction · 0.50
schemaFunction · 0.50
InvalidFunction · 0.50
clearMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected