Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions r/src/array_to_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,10 @@ std::shared_ptr<Converter> Converter::Make(const std::shared_ptr<DataType>& type
return std::make_shared<arrow::r::Converter_Promotion<REALSXP, arrow::UInt32Type>>(
std::move(arrays));

case Type::UINT64:
return std::make_shared<arrow::r::Converter_Promotion<REALSXP, arrow::UInt64Type>>(
std::move(arrays));

case Type::HALF_FLOAT:
return std::make_shared<
arrow::r::Converter_Promotion<REALSXP, arrow::HalfFloatType>>(
Expand Down
8 changes: 8 additions & 0 deletions r/tests/testthat/test-Array.R
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,14 @@ test_that("Array<int8>$as_vector() converts to integer (ARROW-3794)", {
expect_equal(a$as_vector(), 0:255)
})

test_that("Arrays of uint{32,64} convert to numeric", {
u32 <- Array$create(1L)$cast(uint32())
expect_identical(as.vector(u32), 1)

u64 <- Array$create(1L)$cast(uint64())
expect_identical(as.vector(u64), 1)
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those tests are thorough!


test_that("Array$create() recognise arrow::Array (ARROW-3815)", {
a <- Array$create(1:10)
expect_equal(a, Array$create(a))
Expand Down
2 changes: 1 addition & 1 deletion r/vignettes/arrow.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ In the tables, entries with a `-` are not currently implemented.
| uint8 | integer |
| uint16 | integer |
| uint32 | double |
| uint64 | - |
| uint64 | double |
| float16 | - |
| float32 | double |
| float64 | double |
Expand Down