| 517 | } // namespace |
| 518 | |
| 519 | arrow::Result<StatementQueryTicket> StatementQueryTicket::Deserialize( |
| 520 | std::string_view serialized) { |
| 521 | pb::sql::TicketStatementQuery command; |
| 522 | google::protobuf::Any any; |
| 523 | if (!any.ParseFromArray(serialized.data(), static_cast<int>(serialized.size()))) { |
| 524 | return Status::Invalid("Unable to parse ticket"); |
| 525 | } |
| 526 | if (!any.UnpackTo(&command)) { |
| 527 | return Status::Invalid("Unable to unpack TicketStatementQuery"); |
| 528 | } |
| 529 | StatementQueryTicket result; |
| 530 | result.statement_handle = command.statement_handle(); |
| 531 | return result; |
| 532 | } |
| 533 | |
| 534 | arrow::Result<std::string> CreateStatementQueryTicket( |
| 535 | const std::string& statement_handle) { |