You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/05/09 23:57:38 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6312: feat: negation of `Intervals`

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


##########
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 think it is related to the fact that interval gets parsed to the same IntervalMonthDayNano all the time -- which was changed in https://github.com/apache/arrow-datafusion/pull/5806
   
   I think to handle it properly we need to have cast support between the different interval types, maybe 🤔 



-- 
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-unsubscribe@arrow.apache.org

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