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

Function Execute

cpp/examples/arrow/filesystem_usage_example.cc:27–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25// Demonstrate dynamically loading a user-defined Arrow FileSystem
26
27arrow::Status Execute() {
28 ARROW_RETURN_NOT_OK(arrow::fs::LoadFileSystemFactories(FILESYSTEM_EXAMPLE_LIBPATH));
29
30 std::string uri = "example:///example_file";
31 std::cout << "Uri: " << uri << std::endl;
32
33 std::string path;
34 ARROW_ASSIGN_OR_RAISE(auto fs, arrow::fs::FileSystemFromUri(uri, &path));
35 std::cout << "Path: " << path << std::endl;
36
37 fs::FileSelector sel;
38 sel.base_dir = "/";
39 ARROW_ASSIGN_OR_RAISE(auto infos, fs->GetFileInfo(sel));
40
41 std::cout << "Root directory contains:" << std::endl;
42 for (const auto& info : infos) {
43 std::cout << "- " << info << std::endl;
44 }
45 return arrow::Status::OK();
46}
47
48int main() {
49 auto status = Execute();

Callers 1

mainFunction · 0.70

Calls 2

LoadFileSystemFactoriesFunction · 0.85
OKFunction · 0.50

Tested by

no test coverage detected