Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty print for interval types has wrong formatting #3092

Closed
Jefffrey opened this issue Nov 12, 2022 · 1 comment · Fixed by #3093
Closed

Pretty print for interval types has wrong formatting #3092

Jefffrey opened this issue Nov 12, 2022 · 1 comment · Fixed by #3093
Labels
arrow Changes to the arrow crate bug

Comments

@Jefffrey
Copy link
Contributor

Describe the bug

Fractional part of seconds for IntervalDayTime and IntervalMonthDayNano is printed incorrectly.

To Reproduce

When doing select with datafusion-cli, can see seconds fraction is incorrect:

DataFusion CLI v14.0.0
❯ select interval '1 millisecond';
+------------------------------------------------+
| IntervalDayTime("1")                           |
+------------------------------------------------+
| 0 years 0 mons 0 days 0 hours 0 mins 0.01 secs |
+------------------------------------------------+
1 row in set. Query took 0.002 seconds.
❯ select interval '10 millisecond';
+------------------------------------------------+
| IntervalDayTime("10")                          |
+------------------------------------------------+
| 0 years 0 mons 0 days 0 hours 0 mins 0.10 secs |
+------------------------------------------------+
1 row in set. Query took 0.001 seconds.
❯ select interval '100 millisecond';
+-------------------------------------------------+
| IntervalDayTime("100")                          |
+-------------------------------------------------+
| 0 years 0 mons 0 days 0 hours 0 mins 0.100 secs |
+-------------------------------------------------+
1 row in set. Query took 0.001 seconds.
❯ select interval '1 month 1 millisecond';
+-------------------------------------------------------+
| IntervalMonthDayNano("79228162514264337593544950336") |
+-------------------------------------------------------+
| 0 years 1 mons 0 days 0 hours 0 mins 0.1000000 secs   |
+-------------------------------------------------------+
1 row in set. Query took 0.001 seconds.
❯ select interval '1 month 10 millisecond';
+-------------------------------------------------------+
| IntervalMonthDayNano("79228162514264337593553950336") |
+-------------------------------------------------------+
| 0 years 1 mons 0 days 0 hours 0 mins 0.10000000 secs  |
+-------------------------------------------------------+
1 row in set. Query took 0.002 seconds.
❯ select interval '1 month 100 millisecond';
+-------------------------------------------------------+
| IntervalMonthDayNano("79228162514264337593643950336") |
+-------------------------------------------------------+
| 0 years 1 mons 0 days 0 hours 0 mins 0.100000000 secs |
+-------------------------------------------------------+

Expected behavior

Expect 1 millisecond to print as 0.001 secs, 10 ms as 0.01 secs, 100 ms as 0.1 secs, and so on.

Additional context

@Jefffrey Jefffrey added the bug label Nov 12, 2022
@alamb alamb added the arrow Changes to the arrow crate label Nov 25, 2022
@alamb
Copy link
Contributor

alamb commented Nov 25, 2022

label_issue.py automatically added labels {'arrow'} from #3093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants