andishgar commented on code in PR #46031:
URL: https://github.com/apache/arrow/pull/46031#discussion_r2057586695
##########
cpp/src/arrow/record_batch_test.cc:
##########
@@ -1215,6 +1244,21 @@ Result<std::shared_ptr<Array>> MakeStatisticsArray(
std::move(statistics_array)};
return std::make_shared<StructArray>(struct_type, n_columns, struct_arrays);
}
+
+std::shared_ptr<Array> GenerateString(
+ const std::shared_ptr<::arrow::DataType>& data_type) {
+ if (data_type->id() == Type::FIXED_SIZE_BINARY) {
+ auto byte_width = data_type->byte_width();
+ auto a = std::string(byte_width, 'a');
+ auto b = std::string(byte_width, 'b');
+ auto c = std::string(byte_width, 'c');
+ std::stringstream ss;
+ ss << R"([")" << a << R"(",")" << b << R"(",")" << c << R"("])";
+ return ArrayFromJSON(data_type, ss.str());
+ }
+ return ArrayFromJSON(data_type, R"(["a","b","c"])");
Review Comment:
Generally,I already have some studies about CPU pipelines and branch
prediction in a computer architecture textbook (csapp). Does my style of code
have any point in this subject? (Although this is a test, and as I figure out
readability, it's much more important. I know one way Arrow tackles this is to
define ARROW_PREDICATE_TRUE and ARROW_PREDICATE_FALSE, which becomes handy in
error-checking code.)
--
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]