| 74 | } |
| 75 | |
| 76 | Result<std::shared_ptr<Table>> GetInputTable( |
| 77 | const std::vector<std::string>& arguments, |
| 78 | const std::vector<std::shared_ptr<DataType>>& data_types) { |
| 79 | std::vector<std::shared_ptr<Array>> columns; |
| 80 | std::vector<std::shared_ptr<Field>> fields; |
| 81 | EXPECT_EQ(arguments.size(), data_types.size()); |
| 82 | for (std::size_t i = 0; i < arguments.size(); i++) { |
| 83 | if (data_types[i]) { |
| 84 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Array> arg_array, |
| 85 | GetArray(arguments[i], data_types[i])); |
| 86 | columns.push_back(std::move(arg_array)); |
| 87 | fields.push_back(field("arg_" + std::to_string(i), data_types[i])); |
| 88 | } |
| 89 | } |
| 90 | std::shared_ptr<RecordBatch> batch = |
| 91 | RecordBatch::Make(schema(std::move(fields)), 1, columns); |
| 92 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Table> table, Table::FromRecordBatches({batch})); |
| 93 | return table; |
| 94 | } |
| 95 | |
| 96 | Result<std::shared_ptr<Table>> GetOutputTable( |
| 97 | const std::string& output_value, const std::shared_ptr<DataType>& output_type) { |
no test coverage detected