Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.

Commit 7b2625e

Browse files
committed
add fn hour()
1 parent c3980af commit 7b2625e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/functions/scalar.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,16 @@ impl ScalarFunctions {
247247
pub fn greatest() {}
248248
pub fn hash() {}
249249
pub fn hex() {}
250-
pub fn hour() {}
250+
pub fn hour<T>(array: Vec<&PrimitiveArray<T>>) -> Result<Vec<Int32Array>, ArrowError>
251+
where
252+
T: ArrowNumericType + ArrowTemporalType,
253+
i64: std::convert::From<T::Native>
254+
{
255+
array
256+
.iter()
257+
.map(|a| compute::hour(a))
258+
.collect()
259+
}
251260
pub fn hypot<T>(
252261
a: &PrimitiveArray<T>,
253262
b: &PrimitiveArray<T>,

0 commit comments

Comments
 (0)