You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/12/24 16:19:45 UTC

[GitHub] [arrow] Dandandan commented on a change in pull request #9004: ARROW-11025: [Rust] Fixed bench for binary boolean kernels

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:
users@infra.apache.org