waitingkuo opened a new issue, #4237:
URL: https://github.com/apache/arrow-datafusion/issues/4237
**Describe the bug**
bug parsing interval that contains negative values
**To Reproduce**
```bash
❯ select (interval '1 month -1 second');
+---------------------------------------------------+
| IntervalMonthDayNano("-1000000000") |
+---------------------------------------------------+
| 0 years -1 mons -1 days 0 hours 0 mins -1.00 secs |
+---------------------------------------------------+
1 row in set. Query took 0.002 seconds.
```
this is a parsing issue but not a display issue, underline value is
incorrect `IntervalMonthDayNano("-1000000000") `
**Expected behavior**
`0 year 1 mons 0 days 0 hours 0 mins -1 secs`
**Additional context**
https://github.com/apache/arrow-datafusion/blob/406c1087bc16f8d2a49e5a9b05d2a0e1b67f7aa5/datafusion/common/src/parsers.rs#L151-L152
the binary expression for `result nanos` (which is 128bit long here) is
`111111111111111.........` which make months and days becomes negative
--
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]