sgrebnov commented on code in PR #11589:
URL: https://github.com/apache/datafusion/pull/11589#discussion_r1685929050


##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -1184,10 +1338,7 @@ impl Unparser<'_> {
                             fractional_seconds_precision: None,
                         };
                         Ok(ast::Expr::Interval(interval))
-                    } else if v.months == 0
-                        && v.days >= 0
-                        && v.nanoseconds % 1_000_000 == 0
-                    {
+                    } else if v.months == 0 && v.nanoseconds % 1_000_000 == 0 {

Review Comment:
   This is intentional change (removed `v.days >= 0`) to fix interval 
generation for `IntervalStyle::SQLStandard` and negative days, the following  
additional test was added for SQLStandard (didn't work previously)
   
   ```rust
               (
                   interval_month_day_nano_lit("-1.5 DAY"),
                   IntervalStyle::SQLStandard,
                   "INTERVAL '-1 -12:0:0.000' DAY TO SECOND",
               ),
   ```
   



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to