Abhisheklearn12 commented on code in PR #10436:
URL: https://github.com/apache/arrow-rs/pull/10436#discussion_r3789965034
##########
arrow-cast/src/cast/mod.rs:
##########
@@ -7639,6 +7639,316 @@ mod tests {
assert_eq!(casted_binary_array.as_ref(), &binary_view_array);
}
+ /// Casting a dictionary to a view type has two implementations: building
one view per row
+ /// directly against the values buffer, and `unpack_dictionary`. Which one
runs depends on
+ /// how the row count compares to the dictionary size, so these helpers
pin both branches of
+ /// that choice for each arm.
+ ///
+ /// `values` must have 6 entries; the returned key sets sit either side of
the threshold.
+ fn keys_taking_direct_path() -> Int32Array {
+ // 2 keys < 6/2 values -> views are built directly per row
+ Int32Array::from_iter([Some(0), Some(3)])
+ }
Review Comment:
also i forgot to say, i left the older dict to view tests
(`test_dict_to_view`, `test_string_dicts_to_binary_view`,
`test_binary_dicts_to_string_view`) in `mod.rs` since they're already on main,
happy to move them in a follow up if you'd rather they all sit together :)
--
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]