korowa commented on code in PR #8721:
URL: https://github.com/apache/arrow-datafusion/pull/8721#discussion_r1440838868
##########
datafusion/physical-expr/src/aggregate/utils.rs:
##########
@@ -211,3 +211,21 @@ pub(crate) fn ordering_fields(
pub fn get_sort_options(ordering_req: &[PhysicalSortExpr]) -> Vec<SortOptions>
{
ordering_req.iter().map(|item| item.options).collect()
}
+
+/// A wrapper around a type to provide hash for primitive arrow types
+#[derive(Copy, Clone)]
+pub(crate) struct Hashable<T>(pub T);
+
+impl<T: ToByteSlice> std::hash::Hash for Hashable<T> {
+ fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+ self.0.to_byte_slice().hash(state)
Review Comment:
You're right, it only required for floats (and it only makes sense to use it
for floats, cause default implementations of these traits for integers
outperforms this one).
--
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]