jackwener commented on code in PR #5806: URL: https://github.com/apache/arrow-datafusion/pull/5806#discussion_r1155994250
########## datafusion/core/tests/sqllogictests/test_files/interval.slt: ########## @@ -23,7 +23,113 @@ select arrow_typeof(interval '5 months'), arrow_typeof(interval '5 days 3 nanoseconds') ---- -Interval(YearMonth) Interval(MonthDayNano) +Interval(MonthDayNano) Interval(MonthDayNano) + + +## This is incredibly confusing but document it in tests: +# +# years is parsed as a column name +# year is parsed as part of the interval type. +# +# postgres=# select interval '5' year; +# interval +# ---------- +# 5 years +# (1 row) +# +# postgres=# select interval '5' years; +# years +# ---------- +# 00:00:05 +# (1 row) +query ? +select interval '5' years +---- +0 years 0 mons 0 days 0 hours 0 mins 5.000000000 secs + + +# check all different kinds of intervals +query ? +select interval '5' year +---- +0 years 60 mons 0 days 0 hours 0 mins 0.000000000 secs Review Comment: A little strange, I think it will be reasonable to use '5' year. I think `interval '24' month -> 0 years 24 mons` is reasonable. But it's strange `interval '2' year -> 0 years 24 mons` -- 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]
