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

cast format 'yyyymmdd' to Date32 give a error #5044

Closed
Tangruilin opened this issue Nov 6, 2023 · 6 comments · Fixed by #5078
Closed

cast format 'yyyymmdd' to Date32 give a error #5044

Tangruilin opened this issue Nov 6, 2023 · 6 comments · Fixed by #5078
Assignees
Labels
arrow Changes to the arrow crate bug

Comments

@Tangruilin
Copy link
Contributor

Describe the bug
when cast string like '19990819' to Date32, it will give a error, but for '1999-08-19' it secceed

To Reproduce
In arrow-datafusion
For a date column run a query with the date in string format 'yyyymmdd' as shown below

--this query fails
select * from orders where o_orderdate = '19961006'

it get

Arrow error: Cast error: Cannot cast string '19961006' to value of Date32 type

Expected behavior
This should return the correct result and not fail

Additional context

@Tangruilin Tangruilin added the bug label Nov 6, 2023
@Tangruilin
Copy link
Contributor Author

@alamb hey! the bug for apache/datafusion#7465 is belong to this, maybe this issue can be assigned to me and i will fix it

@alamb
Copy link
Contributor

alamb commented Nov 6, 2023

Assigned -- thanks @Tangruilin

@tustvold can you confirm this is a reasonable change to add to arrow-rs? If not, I think we should add the code to DataFusion instead

@tustvold
Copy link
Contributor

tustvold commented Nov 6, 2023

I see no issue with this

Tangruilin added a commit to Tangruilin/arrow-rs that referenced this issue Nov 15, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
Tangruilin added a commit to Tangruilin/arrow-rs that referenced this issue Nov 15, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
@Tangruilin
Copy link
Contributor Author

@alamb @tustvold

@Tangruilin
Copy link
Contributor Author

I have initiated a PR, thanks for review

Tangruilin added a commit to Tangruilin/arrow-rs that referenced this issue Nov 26, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
Tangruilin added a commit to Tangruilin/arrow-rs that referenced this issue Nov 26, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
Tangruilin added a commit to Tangruilin/arrow-rs that referenced this issue Nov 27, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
Tangruilin added a commit to Tangruilin/arrow-rs that referenced this issue Nov 27, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
Tangruilin added a commit to Tangruilin/arrow-rs that referenced this issue Nov 27, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
tustvold pushed a commit that referenced this issue Nov 27, 2023
Signed-off-by: tangruilin <tang.ruilin@foxmail.com>
@tustvold tustvold added the arrow Changes to the arrow crate label Jan 5, 2024
@tustvold
Copy link
Contributor

tustvold commented Jan 5, 2024

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

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.

3 participants