Dandandan commented on a change in pull request #9004:
URL: https://github.com/apache/arrow/pull/9004#discussion_r548593147
##########
File path: rust/arrow/benches/boolean_kernels.rs
##########
@@ -19,48 +19,46 @@
extern crate criterion;
use criterion::Criterion;
+use rand::distributions::{Distribution, Standard};
+use rand::Rng;
+
+use arrow::util::test_util::seedable_rng;
+
extern crate arrow;
use arrow::array::*;
use arrow::compute::kernels::boolean as boolean_kernels;
-/// Helper function to create arrays
-fn create_boolean_array(size: usize) -> BooleanArray {
- let mut builder = BooleanBuilder::new(size);
- for i in 0..size {
- if i % 2 == 0 {
- builder.append_value(true).unwrap();
- } else {
- builder.append_value(false).unwrap();
- }
- }
- builder.finish()
+fn create_boolean(size: usize) -> BooleanArray
+where
+ Standard: Distribution<bool>,
+{
Review comment:
👍
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]