ksuarez1423 commented on code in PR #13859:
URL: https://github.com/apache/arrow/pull/13859#discussion_r943983285
##########
cpp/examples/tutorial_examples/arrow_example.cc:
##########
@@ -0,0 +1,94 @@
+#include <arrow/api.h>
+#include <arrow/result.h>
+#include <arrow/status.h>
+#include <arrow/table.h>
+
+#include <iostream>
+
+using arrow::Status;
+
+namespace {
+
+Status RunMain(int argc, char** argv) {
+
+ // Creating Arrays and Tables
Review Comment:
I added comments to guide through, though I may need to revert some of them
once there's some supporting prose.
##########
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:
Added said explicitness.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]