Skip to content

Commit b7c2f29

Browse files
committed
make hash simple.
1 parent 8807026 commit b7c2f29

File tree

1 file changed

+22
-2
lines changed
  • datafusion/physical-plan/src/aggregates/group_values/single_group_by

1 file changed

+22
-2
lines changed

datafusion/physical-plan/src/aggregates/group_values/single_group_by/primitive.rs

+22-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,30 @@ macro_rules! hash_integer {
5656
})+
5757
};
5858
}
59-
hash_integer!(i8, i16, i32, i64, i128, i256);
60-
hash_integer!(u8, u16, u32, u64);
59+
60+
hash_integer!(i128, i256);
6161
hash_integer!(IntervalDayTime, IntervalMonthDayNano);
6262

63+
64+
macro_rules! hash_integer_simple {
65+
($($t:ty),+) => {
66+
$(impl HashValue for $t {
67+
#[cfg(not(feature = "force_hash_collisions"))]
68+
fn hash(&self, _state: &RandomState) -> u64 {
69+
*self as u64
70+
}
71+
72+
#[cfg(feature = "force_hash_collisions")]
73+
fn hash(&self, _state: &RandomState) -> u64 {
74+
0
75+
}
76+
})+
77+
};
78+
}
79+
80+
hash_integer_simple!(i8, i16, i32, i64);
81+
hash_integer_simple!(u8, u16, u32, u64);
82+
6383
macro_rules! hash_float {
6484
($($t:ty),+) => {
6585
$(impl HashValue for $t {

0 commit comments

Comments
 (0)