You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2025/11/07 15:04:50 UTC
Re: [PR] Optimize `date_trunc` function by avoiding allocations [datafusion]
alamb commented on code in PR #18360:
URL: https://github.com/apache/datafusion/pull/18360#discussion_r2504036359
##########
datafusion/functions/src/datetime/date_trunc.rs:
##########
@@ -493,6 +515,21 @@ fn general_date_trunc_array_fine_granularity<T: ArrowTimestampType>(
}
}
+/// Applies the unary operation in place if possible, or cloning the array if not
+fn try_unary_mut_or_clone<F>(
+ array: PrimitiveArray<Int64Type>,
+ op: F,
+) -> Result<PrimitiveArray<Int64Type>>
+where
+ F: Fn(i64) -> Result<i64>,
Review Comment:
- I filed https://github.com/apache/arrow-rs/issues/8808 to track this idea
-
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org