alamb commented on code in PR #5555:
URL: https://github.com/apache/arrow-datafusion/pull/5555#discussion_r1134319188
##########
datafusion/physical-expr/src/datetime_expressions.rs:
##########
@@ -537,6 +539,40 @@ where
to_ticks(array, 1_000_000_000)
}
+fn epoch<T>(array: &PrimitiveArray<T>) -> Result<Float64Array>
+where
+ T: ArrowTemporalType + ArrowNumericType,
+ i64: From<T::Native>,
+{
+ let mut b = Float64Builder::with_capacity(array.len());
+ match array.data_type() {
+ DataType::Timestamp(tu, _) => {
+ for i in 0..array.len() {
+ if array.is_null(i) {
+ b.append_null();
+ } else {
+ let scale = match tu {
Review Comment:
I double checked that this is consistent with postgres docs:
https://www.postgresql.org/docs/8.1/functions-datetime.html. 👍
--
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]