Skip to content

select interval '1 YEAR' error #8465

@QuenKar

Description

@QuenKar

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions