izveigor commented on code in PR #6312:
URL: https://github.com/apache/arrow-datafusion/pull/6312#discussion_r1188947419


##########
datafusion/core/tests/sqllogictests/test_files/interval.slt:
##########
@@ -186,6 +186,30 @@ select interval '1 year' - '1 month' - '1 day' - '1 hour' 
- '1 minute' - '1 seco
 ----
 0 years 11 mons -1 days -1 hours -1 mins -1.001001001 secs
 
+# Interval with string literal negation and leading field
+query ?
+select -interval '5' - '1' - '2' year;
+----
+0 years -24 mons 0 days 0 hours 0 mins 0.000000000 secs

Review Comment:
   I don't clearly know why years always translate to months (See: 
[Example](https://github.com/apache/arrow-datafusion/blob/main/datafusion/core/tests/sqllogictests/test_files/interval.slt#L51-L55))
 (maybe because the output function use `IntervalYearMonth::to_months()`. But, 
I think it is not the actual problem of this PR.



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

Reply via email to