| 270 | } |
| 271 | |
| 272 | void DoInvalidPlanTest(const BatchesWithSchema& l_batches, |
| 273 | const BatchesWithSchema& r_batches, |
| 274 | const AsofJoinNodeOptions& join_options, |
| 275 | const std::string& expected_error_str, |
| 276 | bool fail_on_plan_creation = false) { |
| 277 | ASSERT_OK_AND_ASSIGN(auto plan, ExecPlan::Make(*threaded_exec_context())); |
| 278 | |
| 279 | Declaration join{"asofjoin", join_options}; |
| 280 | join.inputs.emplace_back(Declaration{ |
| 281 | "source", SourceNodeOptions{l_batches.schema, l_batches.gen(false, false)}}); |
| 282 | join.inputs.emplace_back(Declaration{ |
| 283 | "source", SourceNodeOptions{r_batches.schema, r_batches.gen(false, false)}}); |
| 284 | |
| 285 | if (fail_on_plan_creation) { |
| 286 | EXPECT_RAISES_WITH_MESSAGE_THAT( |
| 287 | Invalid, ::testing::HasSubstr(expected_error_str), |
| 288 | DeclarationToStatus(std::move(join), /*use_threads=*/false)); |
| 289 | } else { |
| 290 | EXPECT_RAISES_WITH_MESSAGE_THAT(Invalid, ::testing::HasSubstr(expected_error_str), |
| 291 | join.AddToPlan(plan.get())); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | void DoRunInvalidPlanTest(const BatchesWithSchema& l_batches, |
| 296 | const BatchesWithSchema& r_batches, |
no test coverage detected