Abhisheklearn12 commented on code in PR #10596:
URL: https://github.com/apache/arrow-rs/pull/10596#discussion_r3744705122
##########
arrow/benches/cast_kernels.rs:
##########
@@ -202,6 +202,44 @@ fn build_nested_dict_array(size: usize) -> ArrayRef {
Arc::new(DictionaryArray::new(outer_keys, Arc::new(inner)))
}
+// Keys for a `size` row dictionary, spread over `distinct` values so a cast
has to touch
+// the whole values buffer rather than a contiguous prefix of it.
+fn dict_keys(size: usize, distinct: usize) -> UInt64Array {
+ let mut rng = seedable_rng();
+ let range = Uniform::new(0, distinct as u64).unwrap();
+ UInt64Array::from_iter_values((0..size).map(|_| rng.sample(range)))
+}
+
+// `Dictionary<UInt64, Utf8>` of `size` rows over `distinct` values, each
longer than 12
+// bytes so the resulting views reference the values buffer rather than
inlining.
Review Comment:
done this, values now alternate short and long so both view paths get
exercised
--
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]