benbellick commented on code in PR #26835:
URL: https://github.com/apache/datafusion/pull/26835#discussion_r4419611733


##########
datafusion/functions/src/datetime/date_bin.rs:
##########
@@ -289,6 +289,25 @@ impl ScalarUDFImpl for DateBinFunc {
         }
     }
 
+    fn supports_range_key_locality_analysis_with_args(
+        &self,
+        argument_types: &[DataType],
+        literal_arguments: &[Option<&ScalarValue>],
+    ) -> bool {
+        // With the epoch origin, a positive nanosecond stride rounds down
+        // monotonically. Timestamp binning preserves NULLs or returns an 
error.
+        match (argument_types, literal_arguments) {
+            (
+                [
+                    DataType::Interval(MonthDayNano),
+                    Timestamp(Nanosecond, None),
+                ],
+                [Some(ScalarValue::IntervalMonthDayNano(Some(stride))), None],
+            ) => stride.months == 0 && stride.days == 0 && stride.nanoseconds 
> 0,

Review Comment:
   Yup, seems reasonable enough here: 
https://github.com/apache/datafusion/commit/890fffdb9d68944f7522be742344b8250fc86100



-- 
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]

Reply via email to