| 519 | } |
| 520 | |
| 521 | void SQLSDKQueryTest::BatchRequestExecuteSQL(hybridse::sqlcase::SqlCase& sql_case, // NOLINT |
| 522 | std::shared_ptr<SQLRouter> router, bool has_batch_request, |
| 523 | bool is_procedure, bool is_asyn) { |
| 524 | if (has_batch_request) { |
| 525 | BatchRequestExecuteSQLWithCommonColumnIndices(sql_case, router, sql_case.batch_request().common_column_indices_, |
| 526 | is_procedure, is_asyn); |
| 527 | } else if (!sql_case.inputs().empty()) { |
| 528 | // set different common column conf |
| 529 | size_t schema_size = sql_case.inputs()[0].columns_.size(); |
| 530 | std::set<size_t> common_column_indices; |
| 531 | |
| 532 | // empty |
| 533 | BatchRequestExecuteSQLWithCommonColumnIndices(sql_case, router, common_column_indices, is_procedure, is_asyn); |
| 534 | |
| 535 | // full |
| 536 | for (size_t i = 0; i < schema_size; ++i) { |
| 537 | common_column_indices.insert(i); |
| 538 | } |
| 539 | BatchRequestExecuteSQLWithCommonColumnIndices(sql_case, router, common_column_indices, is_procedure, is_asyn); |
| 540 | |
| 541 | common_column_indices.clear(); |
| 542 | |
| 543 | // partial |
| 544 | // 0, 2, 4, ... |
| 545 | for (size_t i = 0; i < schema_size; i += 2) { |
| 546 | common_column_indices.insert(i); |
| 547 | } |
| 548 | BatchRequestExecuteSQLWithCommonColumnIndices(sql_case, router, common_column_indices, is_procedure, is_asyn); |
| 549 | |
| 550 | common_column_indices.clear(); |
| 551 | return; |
| 552 | // 1, 3, 5, ... |
| 553 | for (size_t i = 1; i < schema_size; i += 2) { |
| 554 | common_column_indices.insert(i); |
| 555 | } |
| 556 | BatchRequestExecuteSQLWithCommonColumnIndices(sql_case, router, common_column_indices, is_procedure, is_asyn); |
| 557 | } |
| 558 | } |
| 559 | void SQLSDKQueryTest::BatchRequestExecuteSQLWithCommonColumnIndices(hybridse::sqlcase::SqlCase& sql_case, // NOLINT |
| 560 | std::shared_ptr<SQLRouter> router, |
| 561 | const std::set<size_t>& common_indices, |