Omega359 commented on code in PR #19341:
URL: https://github.com/apache/datafusion/pull/19341#discussion_r2636493036
##########
datafusion/functions/src/datetime/date_bin.rs:
##########
@@ -193,11 +245,17 @@ impl ScalarUDFImpl for DateBinFunc {
) -> Result<ColumnarValue> {
let args = &args.args;
if args.len() == 2 {
- // Default to unix EPOCH
- let origin =
ColumnarValue::Scalar(ScalarValue::TimestampNanosecond(
- Some(0),
- Some("+00:00".into()),
- ));
+ let origin = if matches!(args[1].data_type(), Time32(_)) {
+ ColumnarValue::Scalar(ScalarValue::Time32Second(Some(0)))
+ } else if matches!(args[1].data_type(), Time64(_)) {
+ ColumnarValue::Scalar(ScalarValue::Time64Nanosecond(Some(0)))
Review Comment:
True, I'll take a look at this
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]