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

select interval '1 YEAR' error #8465

Closed
QuenKar opened this issue Dec 8, 2023 · 2 comments · Fixed by #8478
Closed

select interval '1 YEAR' error #8465

QuenKar opened this issue Dec 8, 2023 · 2 comments · Fixed by #8478
Assignees
Labels
bug Something isn't working

Comments

@QuenKar
Copy link
Contributor

QuenKar commented Dec 8, 2023

Describe the bug

> select interval '1 YEAR' 
Arrow error: Not yet implemented: Unsupported Interval Expression with value "1 YEAR seconds"

however use lowercase is ok.

> select interval '1 year'
+--------------------------------------------------------+
| IntervalMonthDayNano("950737950171172051122527404032") |
+--------------------------------------------------------+
| 0 years 12 mons 0 days 0 hours 0 mins 0.000000000 secs |
+--------------------------------------------------------+

I try other databases such as duckdb and postgres, and uppercase style is ok.

To Reproduce

use datafusion-cli and select interval '1 YEAR'
DataFusion CLI v33.0.0

Expected behavior

ouput the right result.

Additional context

The reason may be because https://github.com/apache/arrow-datafusion/blob/main/datafusion/sql/src/expr/value.rs#L319
the has_units function just check the lowercase style, and I think add to_lowercase in it can solve this problem.

@QuenKar QuenKar added the bug Something isn't working label Dec 8, 2023
@QuenKar
Copy link
Contributor Author

QuenKar commented Dec 8, 2023

I can try to fix it

@alamb
Copy link
Contributor

alamb commented Dec 8, 2023

I agree this sounds like a good thing to solve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants