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:
   These instantiations seem very repetitive, but the differences between them 
are so subtle, and the format of the union is practically unknown, 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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to