rok commented on code in PR #14341:
URL: https://github.com/apache/arrow/pull/14341#discussion_r1297147443
##########
cpp/src/parquet/test_util.cc:
##########
@@ -132,5 +133,54 @@ void random_byte_array(int n, uint32_t seed, uint8_t* buf,
ByteArray* out, int m
random_byte_array(n, seed, buf, out, 0, max_size);
}
+void prefixed_random_byte_array(int n, uint32_t seed, uint8_t* buf, ByteArray*
out,
+ int min_size, int max_size, double
prefixed_probability) {
+ std::default_random_engine gen(seed);
+ std::uniform_int_distribution<int> dist_size(min_size, max_size);
+ std::uniform_int_distribution<int> dist_byte(0, 255);
+ std::bernoulli_distribution dist_has_prefix(prefixed_probability);
+ std::uniform_real_distribution<double> dist_prefix_length(0, 1);
+
+ for (int i = 0; i < n; ++i) {
+ int len = dist_size(gen);
+ out[i].len = len;
+ out[i].ptr = buf;
+
+ bool do_prefix = dist_has_prefix(gen) && i > 0;
+ std::uniform_int_distribution<int> d4(min_size, len);
Review Comment:
Removed.
--
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]