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

Function SchemaFromColumnNames

cpp/src/arrow/dataset/dataset_internal.h:57–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57inline std::shared_ptr<Schema> SchemaFromColumnNames(
58 const std::shared_ptr<Schema>& input, const std::vector<std::string>& column_names) {
59 std::vector<std::shared_ptr<Field>> columns;
60 for (FieldRef ref : column_names) {
61 auto maybe_field = ref.GetOne(*input);
62 if (maybe_field.ok()) {
63 columns.push_back(std::move(maybe_field).ValueOrDie());
64 }
65 }
66
67 return schema(std::move(columns))->WithMetadata(input->metadata());
68}
69
70/// Get fragment scan options of the expected type.
71/// \return Fragment scan options if provided on the scan options, else the default

Callers 11

TEST_FFunction · 0.85
FinishMethod · 0.85
FinishMethod · 0.85
FinishMethod · 0.85
MakeSourceDatasetMethod · 0.85
MakeBasicDatasetFunction · 0.85
TEST_FFunction · 0.85

Calls 7

GetOneMethod · 0.80
push_backMethod · 0.80
ValueOrDieMethod · 0.80
schemaFunction · 0.50
okMethod · 0.45
WithMetadataMethod · 0.45
metadataMethod · 0.45