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

Function GetOutputTable

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

Source from the content-addressed store, hash-verified

94}
95
96Result<std::shared_ptr<Table>> GetOutputTable(
97 const std::string& output_value, const std::shared_ptr<DataType>& output_type) {
98 std::vector<std::shared_ptr<Array>> columns(1);
99 std::vector<std::shared_ptr<Field>> fields(1);
100 ARROW_ASSIGN_OR_RAISE(columns[0], GetArray(output_value, output_type));
101 fields[0] = field("output", output_type);
102 std::shared_ptr<RecordBatch> batch =
103 RecordBatch::Make(schema(std::move(fields)), 1, columns);
104 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Table> table, Table::FromRecordBatches({batch}));
105 return table;
106}
107
108Result<std::shared_ptr<acero::ExecPlan>> PlanFromTestCase(
109 const FunctionTestCase& test_case, std::shared_ptr<Table>* output_table) {

Callers 1

CheckValidTestCasesFunction · 0.85

Calls 5

GetArrayFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
schemaFunction · 0.50

Tested by

no test coverage detected