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
ARROW-3741: [R] Add support for arrow::compute::Cast to convert Arrow arrays from one type to anothe #2959
Conversation
This needs more work (more tests) and support to cast Table as well, but opening early because I'm seeing some weird stuff: library(arrow)
a <- array(-(1:3))
a$cast(uint16())
#> Error in Array__cast(self, target_type, options): Invalid: Integer value out of bounds
a$cast(uint16())
#> Error in Array__cast(self, target_type, options): Invalid: Integer value out of bounds
a$cast(uint32())
#> arrow::Array
#> [
#> 4294967295,
#> 4294967294,
#> 4294967293
#> ]
a$cast(uint32())$type()
#> arrow::UInt32
#> uint32
a$cast(uint64())
#> arrow::Array
#> [
#> -1,
#> -2,
#> -3
#> ]
a$cast(uint64())$type()
#> arrow::UInt64
#> uint64 Created on 2018-11-14 by the reprex package (v0.2.1.9000) The first two error are what I expect, because |
closes #2953 |
4d8e53c
to
2ab336c
Compare
In the future when you see something that looks buggy, there's no need to wait to open a JIRA (or go through the mailing list to confirm a bug) =) |
2ab336c
to
82c7478
Compare
d468937
to
6ff67b5
Compare
But also using `HalfFloatType` for `HALF_FLOAT`. Testing that a float vector is converted to a numeric by $as_vector()
6ff67b5
to
053bd35
Compare
Is this ready for review? There's a lot of R PR's open; I would appreciate some tips about which ones need to be reviewed |
There's often a rebasing needed between two squashes, probably because some files always change e.g. the generated files or the DESCRIPTION file. I've added the labels |
Thanks, "ready-for-review" works for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. thanks @romainfrancois!
Created on 2018-11-14 by the reprex package (v0.2.1.9000)