| 76 | } |
| 77 | |
| 78 | arrow::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 | |
| 95 | arrow::Result<std::shared_ptr<arrow::TableBatchReader>> GetRBR() { |
| 96 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<arrow::Table> table, GetTable()); |