ovr commented on a change in pull request #9373:
URL: https://github.com/apache/arrow/pull/9373#discussion_r570054053



##########
File path: rust/datafusion/src/sql/planner.rs
##########
@@ -894,6 +908,131 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
             ))),
         }
     }
+
+    fn sql_interval_to_literal(
+        &self,
+        value: &String,
+        leading_field: &Option<DateTimeField>,
+        leading_precision: &Option<u64>,
+        last_field: &Option<DateTimeField>,
+        fractional_seconds_precision: &Option<u64>,
+    ) -> Result<Expr> {
+        if leading_field.is_some() {
+            return Err(DataFusionError::NotImplemented(format!(
+                "Unsupported Interval Expression with leading_field {:?}",
+                leading_field
+            )));
+        }
+
+        if leading_precision.is_some() {
+            return Err(DataFusionError::NotImplemented(format!(
+                "Unsupported Interval Expression with leading_precision {:?}",
+                leading_precision
+            )));
+        }
+
+        if last_field.is_some() {
+            return Err(DataFusionError::NotImplemented(format!(
+                "Unsupported Interval Expression with last_field {:?}",
+                last_field
+            )));
+        }
+
+        if fractional_seconds_precision.is_some() {
+            return Err(DataFusionError::NotImplemented(format!(
+                "Unsupported Interval Expression with 
fractional_seconds_precision {:?}",
+                fractional_seconds_precision
+            )));
+        }
+
+        // Should we resort parts on overflow?
+        let resort_parts = |days: i32, seconds: f32| -> (i32, f32) { (days, 
seconds) };
+
+        let calculate_from_part =
+            |interval_period_str: &str, interval_type: &str| -> Result<(i32, 
f32)> {
+                let interval_period = match interval_period_str.parse::<f32>() 
{

Review comment:
       I dont have any ideas, how it should be correct, but anyway using `0.5 
DAY` or `0.5 HOUR` will be rly usefull and works as expected.
   




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to