| 491 | } |
| 492 | |
| 493 | std::unique_ptr<MockDataset> MakeTestDataset(int num_fragments, int batches_per_fragment, |
| 494 | bool empty = false) { |
| 495 | std::shared_ptr<Schema> test_schema = ScannerTestSchema(); |
| 496 | MockDatasetBuilder dataset_builder(test_schema); |
| 497 | for (int i = 0; i < num_fragments; i++) { |
| 498 | dataset_builder.AddFragment( |
| 499 | test_schema, std::make_unique<InspectedFragment>(test_schema->field_names()), |
| 500 | Fragment::kNoPartitionInformation); |
| 501 | for (int j = 0; j < batches_per_fragment; j++) { |
| 502 | if (empty) { |
| 503 | dataset_builder.AddBatch( |
| 504 | RecordBatch::Make(schema({}), kRowsPerTestBatch, ArrayVector{})); |
| 505 | } else { |
| 506 | dataset_builder.AddBatch(MakeTestBatch(i * batches_per_fragment + j)); |
| 507 | } |
| 508 | } |
| 509 | } |
| 510 | return dataset_builder.Finish(); |
| 511 | } |
| 512 | |
| 513 | class TestScannerBase : public ::testing::TestWithParam<ScannerTestParams> { |
| 514 | protected: |
no test coverage detected