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

Function GetDatasetFromPath

cpp/examples/arrow/dataset_parquet_scan_example.cc:131–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131arrow::Result<std::shared_ptr<ds::Dataset>> GetDatasetFromPath(
132 std::shared_ptr<fs::FileSystem> fs, std::shared_ptr<ds::ParquetFileFormat> format,
133 std::string path) {
134 ARROW_ASSIGN_OR_RAISE(auto info, fs->GetFileInfo(path));
135 if (info.IsDirectory()) {
136 return GetDatasetFromDirectory(fs, format, path);
137 }
138
139 auto dirname_basename = arrow::fs::internal::GetAbstractPathParent(path);
140 auto basename = dirname_basename.second;
141
142 if (basename == "_metadata") {
143 return GetParquetDatasetFromMetadata(fs, format, path);
144 }
145
146 return GetDatasetFromFile(fs, format, path);
147}
148
149arrow::Result<std::shared_ptr<ds::Scanner>> GetScannerFromDataset(
150 std::shared_ptr<ds::Dataset> dataset, std::vector<std::string> columns,

Callers

nothing calls this directly

Calls 5

GetDatasetFromDirectoryFunction · 0.85
GetAbstractPathParentFunction · 0.85
GetDatasetFromFileFunction · 0.85
IsDirectoryMethod · 0.45

Tested by

no test coverage detected