MCPcopy Create free account
hub / github.com/apache/arrow / GetInputTable

Function GetInputTable

cpp/src/arrow/engine/substrait/function_test.cc:76–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76Result<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
96Result<std::shared_ptr<Table>> GetOutputTable(
97 const std::string& output_value, const std::shared_ptr<DataType>& output_type) {

Callers 1

PlanFromTestCaseFunction · 0.85

Calls 8

GetArrayFunction · 0.85
to_stringFunction · 0.85
push_backMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
schemaFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected