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

Inconsistent behavior for Interval type with document #9525

Closed
yyy1000 opened this issue Mar 10, 2024 · 4 comments · Fixed by #9542
Closed

Inconsistent behavior for Interval type with document #9525

yyy1000 opened this issue Mar 10, 2024 · 4 comments · Fixed by #9542
Assignees
Labels
bug Something isn't working

Comments

@yyy1000
Copy link
Contributor

yyy1000 commented Mar 10, 2024

Describe the bug

When I take #9524, I found the behavior of the function is inconsistent with the actual CLI output.
Docs:
https://github.com/apache/arrow-datafusion/blob/eebdbe8be61ba1944b7a7e14d3edeed0259a7d74/docs/source/user-guide/sql/data_types.md?plain=1#L32-L38
Output from local CLI:
DataFusion CLI v35.0.0
❯ select arrow_typeof(interval '1 month');
+---------------------------------------------------------------------+
| arrow_typeof(IntervalMonthDayNano("79228162514264337593543950336")) |
+---------------------------------------------------------------------+
| Interval(MonthDayNano) |
+---------------------------------------------------------------------+
1 row in set. Query took 0.001 seconds.

To Reproduce

Run the same sql

Expected behavior

No response

Additional context

I'm researching whether it's because the docs is outdated or there's some issue related to Interval type

@yyy1000 yyy1000 added the bug Something isn't working label Mar 10, 2024
@yyy1000
Copy link
Contributor Author

yyy1000 commented Mar 10, 2024

take

@alamb
Copy link
Contributor

alamb commented Mar 10, 2024

I don't think this is related to arrow_typeof, I think think it is that the interval syntax always returns a type of IntervalMonthDayNano ... for reasons I can't remember now.

@yyy1000 yyy1000 changed the title Inconsistent behavior for arrow_typeof of Interval type Inconsistent behavior for Interval type Mar 10, 2024
@yyy1000
Copy link
Contributor Author

yyy1000 commented Mar 10, 2024

I don't think this is related to arrow_typeof, I think think it is that the interval syntax always returns a type of IntervalMonthDayNano ... for reasons I can't remember now.

Yeah, I also think so.
I found the reason is #5801
So I think for this issue, I can just update the document.
Also I have a question, when IntervalYearMonth will be used? If it will not be used maybe we can remove this type? @alamb

@yyy1000 yyy1000 changed the title Inconsistent behavior for Interval type Inconsistent behavior for Interval type with document Mar 10, 2024
@alamb
Copy link
Contributor

alamb commented Mar 24, 2024

Also I have a question, when IntervalYearMonth will be used? If it will not be used maybe we can remove this type? @alamb

I don't understand this question -- I think the idea is that IntervalYearMonth is the most general interval type that can support most non fixed width intervals (e.g. 1 month vs 28, 29, 30, 31 days)

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