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

Function GetTable

cpp/examples/arrow/parquet_read_write.cc:78–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78arrow::Result<std::shared_ptr<arrow::Table>> GetTable() {
79 auto builder = arrow::Int32Builder();
80
81 std::shared_ptr<arrow::Array> arr_x;
82 ARROW_RETURN_NOT_OK(builder.AppendValues({1, 3, 5, 7, 1}));
83 ARROW_RETURN_NOT_OK(builder.Finish(&arr_x));
84
85 std::shared_ptr<arrow::Array> arr_y;
86 ARROW_RETURN_NOT_OK(builder.AppendValues({2, 4, 6, 8, 10}));
87 ARROW_RETURN_NOT_OK(builder.Finish(&arr_y));
88
89 auto schema = arrow::schema(
90 {arrow::field("x", arrow::int32()), arrow::field("y", arrow::int32())});
91
92 return arrow::Table::Make(schema, {arr_x, arr_y});
93}
94
95arrow::Result<std::shared_ptr<arrow::TableBatchReader>> GetRBR() {
96 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<arrow::Table> table, GetTable());

Callers 4

GetRBRFunction · 0.70
WriteFullFileFunction · 0.70
ARROW_ASSIGN_OR_RAISEMethod · 0.50
TEST_FFunction · 0.50

Calls 5

schemaFunction · 0.50
fieldFunction · 0.50
MakeFunction · 0.50
AppendValuesMethod · 0.45
FinishMethod · 0.45

Tested by 2

ARROW_ASSIGN_OR_RAISEMethod · 0.40
TEST_FFunction · 0.40