Skip to content

Apache DataFusion SQL Query Engine

#1768 Support TimeUnit::Second in hasher (#1769)

Richf139ef812590
diff --git a/datafusion/src/physical_plan/hash_utils.rs b/datafusion/src/physical_plan/hash_utils.rs
index 5f7a610db0..27a5376cf7 100644
--- a/datafusion/src/physical_plan/hash_utils.rs
+++ b/datafusion/src/physical_plan/hash_utils.rs
@@ -23,8 +23,8 @@ use arrow::array::{
Array, ArrayRef, BooleanArray, Date32Array, Date64Array, DecimalArray,
DictionaryArray, Float32Array, Float64Array, Int16Array, Int32Array, Int64Array,
Int8Array, LargeStringArray, StringArray, TimestampMicrosecondArray,
- TimestampMillisecondArray, TimestampNanosecondArray, UInt16Array, UInt32Array,
- UInt64Array, UInt8Array,
+ TimestampMillisecondArray, TimestampNanosecondArray, TimestampSecondArray,
+ UInt16Array, UInt32Array, UInt64Array, UInt8Array,
};
use arrow::datatypes::{
ArrowDictionaryKeyType, ArrowNativeType, DataType, Int16Type, Int32Type, Int64Type,
@@ -387,6 +387,16 @@ pub fn create_hashes<'a>(
multi_col
);
}
+ DataType::Timestamp(TimeUnit::Second, None) => {
+ hash_array_primitive!(
+ TimestampSecondArray,
+ col,
+ i64,
+ hashes_buffer,
+ random_state,
+ multi_col
+ );
+ }
DataType::Timestamp(TimeUnit::Millisecond, None) => {
hash_array_primitive!(
TimestampMillisecondArray,