You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/19 07:21:21 UTC
[GitHub] [arrow-datafusion] waitingkuo opened a new issue, #3204: Interval Literal doesn't work for timeunit less than millisecond
waitingkuo opened a new issue, #3204:
URL: https://github.com/apache/arrow-datafusion/issues/3204
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
It works for millisecond
```bash
❯ select interval '1 month 0.001 second';
+-------------------------------------------------------+
| IntervalMonthDayNano("79228162514264337593544950336") |
+-------------------------------------------------------+
| 0 years 1 mons 0 days 0 hours 0 mins 0.1000000 secs |
+-------------------------------------------------------+
1 row in set. Query took 0.001 seconds.
```
but doesn't work while the unit for second less than millisecond
```bash
❯ select interval '1 month 0.0001 second';
+------------------------------------------------+
| IntervalYearMonth("1") |
+------------------------------------------------+
| 0 years 1 mons 0 days 0 hours 0 mins 0.00 secs |
+------------------------------------------------+
1 row in set. Query took 0.002 seconds.
```
**Expected behavior**
A clear and concise description of what you expected to happen.
**Additional context**
Add any other context about the problem here.
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] Jefffrey commented on issue #3204: Interval Literal doesn't work for timeunit less than millisecond
Posted by GitBox <gi...@apache.org>.
Jefffrey commented on issue #3204:
URL: https://github.com/apache/arrow-datafusion/issues/3204#issuecomment-1312368204
Seems to be because of this parsing:
https://github.com/apache/arrow-datafusion/blob/129654cd8466e7634bf186782c3d271541f0671e/datafusion/common/src/parsers.rs#L130-L161
Finest granularity is milliseconds, accumulated as an integer, hence fractions of that are silently ignored.
Could change this accumulator to nanoseconds, as `i64`, however this seems it would conflict with `ScalarValue::IntervalDayTime` which stores milliseconds as `i32`, compared to `ScalarValue::IntervalMonthDayNano` which does store nanoseconds.
Might need to change `ScalarValue::IntervalDayTime` to support nanoseconds perhaps? If want to be consistent between precision of `ScalarValue::IntervalMonthDayNano` and `ScalarValue::IntervalDayTime`
--
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
[GitHub] [arrow-datafusion] alamb closed issue #3204: Interval Literal doesn't work for timeunit less than millisecond
Posted by GitBox <gi...@apache.org>.
alamb closed issue #3204: Interval Literal doesn't work for timeunit less than millisecond
URL: https://github.com/apache/arrow-datafusion/issues/3204
--
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