| 36 | }; |
| 37 | |
| 38 | static 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. |
| 62 | static void GetAllFragments(benchmark::State& state) { |
no test coverage detected