ksuarez1423 commented on code in PR #13859: URL: https://github.com/apache/arrow/pull/13859#discussion_r943949027
########## cpp/examples/tutorial_examples/compute_example.cc: ########## @@ -0,0 +1,64 @@ +#include <arrow/api.h> +#include <arrow/result.h> +#include <arrow/status.h> +#include <arrow/table.h> +#include <arrow/compute/api.h> + +#include <iostream> + +using arrow::Status; + +namespace { + +Status RunMain(int argc, char** argv) { + + // Saving and Loading Tables + + arrow::Int32Builder int32builder; + int32_t some_nums_raw[5] = {34, 624, 2223, 5654, 4356}; + ARROW_RETURN_NOT_OK(int32builder.AppendValues(some_nums_raw, 5)); + std::shared_ptr<arrow::Array> some_nums; + ARROW_ASSIGN_OR_RAISE(some_nums, int32builder.Finish()); + + int32_t more_nums_raw[5] = {75342, 23, 64, 17, 736}; + ARROW_RETURN_NOT_OK(int32builder.AppendValues(more_nums_raw, 5)); + std::shared_ptr<arrow::Array> more_nums; + ARROW_ASSIGN_OR_RAISE(more_nums, int32builder.Finish()); + + std::shared_ptr<arrow::Field> field_a, field_b; + std::shared_ptr<arrow::Schema> schema; + + field_a = arrow::field("A", arrow::int32()); + field_b = arrow::field("B", arrow::int32()); + + schema = arrow::schema({field_a, field_b}); + + std::shared_ptr<arrow::Table> table; + table = arrow::Table::Make(schema, {some_nums, more_nums}, 5); + + // Performing Computations Review Comment: Working on this and the comment above currently. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org