| 189 | } |
| 190 | |
| 191 | arrow::Result<GetTables> ParseCommandGetTables(const google::protobuf::Any& any) { |
| 192 | pb::sql::CommandGetTables command; |
| 193 | if (!any.UnpackTo(&command)) { |
| 194 | return Status::Invalid("Unable to unpack CommandGetTables."); |
| 195 | } |
| 196 | |
| 197 | std::vector<std::string> table_types(command.table_types_size()); |
| 198 | std::copy(command.table_types().begin(), command.table_types().end(), |
| 199 | table_types.begin()); |
| 200 | |
| 201 | GetTables result; |
| 202 | result.catalog = PROPERTY_TO_OPTIONAL(command, catalog); |
| 203 | result.db_schema_filter_pattern = |
| 204 | PROPERTY_TO_OPTIONAL(command, db_schema_filter_pattern); |
| 205 | result.table_name_filter_pattern = |
| 206 | PROPERTY_TO_OPTIONAL(command, table_name_filter_pattern); |
| 207 | result.table_types = table_types; |
| 208 | result.include_schema = command.include_schema(); |
| 209 | return result; |
| 210 | } |
| 211 | |
| 212 | arrow::Result<StatementUpdate> ParseCommandStatementUpdate( |
| 213 | const google::protobuf::Any& any) { |