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

Function GetDataset

cpp/src/arrow/dataset/file_benchmark.cc:38–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36};
37
38static SampleDataset GetDataset() {
39 std::vector<fs::FileInfo> files;
40 std::vector<std::string> paths;
41 for (int a = 0; a < 100; a++) {
42 for (int b = 0; b < 100; b++) {
43 auto path = "a=" + std::to_string(a) + "/b=" + std::to_string(b) + "/data.feather";
44 files.push_back(fs::File(path));
45 paths.push_back(path);
46 }
47 }
48 EXPECT_OK_AND_ASSIGN(auto fs,
49 arrow::fs::internal::MockFileSystem::Make(fs::kNoTime, files));
50 auto format = std::make_shared<IpcFileFormat>();
51 FileSystemFactoryOptions options;
52 options.partitioning = HivePartitioning::MakeFactory();
53 EXPECT_OK_AND_ASSIGN(auto factory,
54 FileSystemDatasetFactory::Make(fs, paths, format, options));
55 FinishOptions finish_options;
56 finish_options.inspect_options.fragments = 0;
57 EXPECT_OK_AND_ASSIGN(auto dataset, factory->Finish(finish_options));
58 return {dataset, static_cast<int64_t>(paths.size())};
59}
60
61// A benchmark of filtering fragments in a dataset.
62static void GetAllFragments(benchmark::State& state) {

Callers 2

GetAllFragmentsFunction · 0.70
GetFilteredFragmentsFunction · 0.70

Calls 4

to_stringFunction · 0.85
push_backMethod · 0.80
FileClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected