| 554 | } |
| 555 | |
| 556 | Status FlightSqlServerBase::GetFlightInfo(const ServerCallContext& context, |
| 557 | const FlightDescriptor& request, |
| 558 | std::unique_ptr<FlightInfo>* info) { |
| 559 | google::protobuf::Any any; |
| 560 | if (!any.ParseFromArray(request.cmd.data(), static_cast<int>(request.cmd.size()))) { |
| 561 | return Status::Invalid("Unable to parse command"); |
| 562 | } |
| 563 | |
| 564 | if (any.Is<pb::sql::CommandStatementQuery>()) { |
| 565 | ARROW_ASSIGN_OR_RAISE(StatementQuery internal_command, |
| 566 | ParseCommandStatementQuery(any)); |
| 567 | ARROW_ASSIGN_OR_RAISE(*info, |
| 568 | GetFlightInfoStatement(context, internal_command, request)); |
| 569 | return Status::OK(); |
| 570 | } else if (any.Is<pb::sql::CommandStatementSubstraitPlan>()) { |
| 571 | ARROW_ASSIGN_OR_RAISE(StatementSubstraitPlan internal_command, |
| 572 | ParseCommandStatementSubstraitPlan(any)); |
| 573 | ARROW_ASSIGN_OR_RAISE(*info, |
| 574 | GetFlightInfoSubstraitPlan(context, internal_command, request)); |
| 575 | return Status::OK(); |
| 576 | } else if (any.Is<pb::sql::CommandPreparedStatementQuery>()) { |
| 577 | ARROW_ASSIGN_OR_RAISE(PreparedStatementQuery internal_command, |
| 578 | ParseCommandPreparedStatementQuery(any)); |
| 579 | ARROW_ASSIGN_OR_RAISE( |
| 580 | *info, GetFlightInfoPreparedStatement(context, internal_command, request)); |
| 581 | return Status::OK(); |
| 582 | } else if (any.Is<pb::sql::CommandGetCatalogs>()) { |
| 583 | ARROW_ASSIGN_OR_RAISE(*info, GetFlightInfoCatalogs(context, request)); |
| 584 | return Status::OK(); |
| 585 | } else if (any.Is<pb::sql::CommandGetDbSchemas>()) { |
| 586 | ARROW_ASSIGN_OR_RAISE(GetDbSchemas internal_command, ParseCommandGetDbSchemas(any)); |
| 587 | ARROW_ASSIGN_OR_RAISE(*info, |
| 588 | GetFlightInfoSchemas(context, internal_command, request)); |
| 589 | return Status::OK(); |
| 590 | } else if (any.Is<pb::sql::CommandGetTables>()) { |
| 591 | ARROW_ASSIGN_OR_RAISE(GetTables command, ParseCommandGetTables(any)); |
| 592 | ARROW_ASSIGN_OR_RAISE(*info, GetFlightInfoTables(context, command, request)); |
| 593 | return Status::OK(); |
| 594 | } else if (any.Is<pb::sql::CommandGetTableTypes>()) { |
| 595 | ARROW_ASSIGN_OR_RAISE(*info, GetFlightInfoTableTypes(context, request)); |
| 596 | return Status::OK(); |
| 597 | } else if (any.Is<pb::sql::CommandGetXdbcTypeInfo>()) { |
| 598 | ARROW_ASSIGN_OR_RAISE(GetXdbcTypeInfo internal_command, |
| 599 | ParseCommandGetXdbcTypeInfo(any)); |
| 600 | ARROW_ASSIGN_OR_RAISE(*info, |
| 601 | GetFlightInfoXdbcTypeInfo(context, internal_command, request)) |
| 602 | return Status::OK(); |
| 603 | } else if (any.Is<pb::sql::CommandGetSqlInfo>()) { |
| 604 | ARROW_ASSIGN_OR_RAISE(GetSqlInfo internal_command, |
| 605 | ParseCommandGetSqlInfo(any, sql_info_id_to_result_)); |
| 606 | ARROW_ASSIGN_OR_RAISE(*info, |
| 607 | GetFlightInfoSqlInfo(context, internal_command, request)); |
| 608 | return Status::OK(); |
| 609 | } else if (any.Is<pb::sql::CommandGetPrimaryKeys>()) { |
| 610 | ARROW_ASSIGN_OR_RAISE(GetPrimaryKeys internal_command, |
| 611 | ParseCommandGetPrimaryKeys(any)); |
| 612 | ARROW_ASSIGN_OR_RAISE(*info, |
| 613 | GetFlightInfoPrimaryKeys(context, internal_command, request)); |
no test coverage detected