gstvg commented on code in PR #12116:
URL: https://github.com/apache/datafusion/pull/12116#discussion_r1727611010


##########
datafusion/functions/benches/union_extract.rs:
##########
@@ -0,0 +1,1121 @@
+#[macro_use]
+extern crate criterion;
+
+use crate::criterion::Criterion;
+use arrow::{
+    array::{
+        Array, BooleanArray, Int32Array, Int8Array, NullArray, StringArray, 
UnionArray,
+    },
+    datatypes::{DataType, Field, Int32Type, Int8Type, UnionFields, UnionMode},
+    util::bench_util::{
+        create_boolean_array, create_primitive_array, create_string_array,
+    },
+};
+use arrow_buffer::ScalarBuffer;
+use criterion::black_box;
+use datafusion_common::ScalarValue;
+use datafusion_expr::{ColumnarValue, ScalarUDFImpl};
+use datafusion_functions::core::union_extract::{
+    eq_scalar_generic, is_sequential_generic, UnionExtractFun,
+};
+use itertools::repeat_n;
+use rand::random;
+use std::sync::Arc;
+
+fn criterion_benchmark(c: &mut Criterion) {
+    let union_extract = UnionExtractFun::new();
+

Review Comment:
   Although most part of these instantiations are very repetitive, the 
differences between them are so subtle that I personally prefer to be as 
explicit as possible. Just ask for simplification if that's preferable.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to