You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
the output of INTERVAL XXX is inconsistent
To Reproduce
Steps to reproduce the behavior:
while we only have year or month, it outputs IntervalYearMonth
❯ selectinterval'1 year';
+------------------------------------------------+
| IntervalYearMonth("12") |
+------------------------------------------------+
| 1 years 0 mons 0 days 0 hours 0 mins 0.00 secs |
+------------------------------------------------+
1 row in set. Query took 0.001 seconds.
❯ selectinterval'1 year 1 month';
+------------------------------------------------+
| IntervalYearMonth("13") |
+------------------------------------------------+
| 1 years 1 mons 0 days 0 hours 0 mins 0.00 secs |
+------------------------------------------------+
while we have (year or month) and any other unit, it outputs IntervalMonthDayNano
+--------------------------------------------------------+
| IntervalMonthDayNano("950737950189618795196236955648") |
+--------------------------------------------------------+
| 0 years 12 mons 1 days 0 hours 0 mins 0.00 secs |
+--------------------------------------------------------+
1 row in set. Query took 0.001 seconds.
❯ selectinterval'1 year 1 second';
+--------------------------------------------------------+
| IntervalMonthDayNano("950737950171172051123527404032") |
+--------------------------------------------------------+
| 0 years 12 mons 0 days 0 hours 0 mins 1.00 secs |
+--------------------------------------------------------+
1 row in set. Query took 0.001 seconds.
Otherwise, it outputs IntervalDaytime
❯ selectinterval'1 second';
+------------------------------------------------+
| IntervalDayTime("1000") |
+------------------------------------------------+
| 0 years 0 mons 0 days 0 hours 0 mins 1.00 secs |
+------------------------------------------------+
1 row in set. Query took 0.001 seconds.
❯ selectinterval'1 day 1 second';
+------------------------------------------------+
| IntervalDayTime("4294968296") |
+------------------------------------------------+
| 0 years 0 mons 1 days 0 hours 0 mins 1.00 secs |
+------------------------------------------------+
1 row in set. Query took 0.001 seconds.
Expected behavior
A clear and concise description of what you expected to happen.
they should be consistent, as our current Timestamp is in nanosecond, i suggest using IntervalMonthDayNano. We could consider add functions to output specific data type(i.e. to_interval_monthdaynano(), to_interval_daytime(), interval_yearmonth() . But i think they might need different arithmetics
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
the output of
INTERVAL XXX
is inconsistentTo Reproduce
Steps to reproduce the behavior:
while we only have year or month,
it outputs IntervalYearMonth
while we have (year or month) and any other unit, it outputs
IntervalMonthDayNano
Otherwise, it outputs
IntervalDaytime
Expected behavior
A clear and concise description of what you expected to happen.
they should be consistent, as our current Timestamp is in nanosecond, i suggest using
IntervalMonthDayNano
. We could consider add functions to output specific data type(i.e.to_interval_monthdaynano()
,to_interval_daytime()
,interval_yearmonth()
. But i think they might need different arithmeticsAdditional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: