| 141 | } |
| 142 | |
| 143 | void ScanOnly( |
| 144 | size_t num_batches, size_t batch_size, const std::string& factory_name, |
| 145 | std::function<Result<std::shared_ptr<acero::ExecNodeOptions>>(size_t, size_t)> |
| 146 | options_factory) { |
| 147 | // ensure arrow::dataset node factories are in the registry |
| 148 | ::arrow::dataset::internal::Initialize(); |
| 149 | |
| 150 | RecordBatchVector batches = GetBatches(num_batches, batch_size); |
| 151 | |
| 152 | std::shared_ptr<Dataset> dataset = |
| 153 | std::make_shared<InMemoryDataset>(GetSchema(), batches); |
| 154 | |
| 155 | ASSERT_OK_AND_ASSIGN(std::shared_ptr<acero::ExecNodeOptions> node_options, |
| 156 | options_factory(num_batches, batch_size)); |
| 157 | |
| 158 | // construct the plan |
| 159 | acero::Declaration scan(factory_name, std::move(node_options)); |
| 160 | |
| 161 | ASSERT_OK_AND_ASSIGN(std::shared_ptr<Table> collected, |
| 162 | acero::DeclarationToTable(std::move(scan))); |
| 163 | |
| 164 | ASSERT_GT(collected->num_rows(), 0); |
| 165 | if (factory_name == "scan") { |
| 166 | ASSERT_EQ(collected->num_columns(), 6); |
| 167 | } else if (factory_name == "scan2") { |
| 168 | ASSERT_EQ(collected->num_columns(), 2); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | static constexpr int kScanIdx = 0; |
| 173 | static constexpr int kScanV2Idx = 1; |
no test coverage detected