thisisnic commented on code in PR #15211:
URL: https://github.com/apache/arrow/pull/15211#discussion_r1068210711
##########
r/tests/testthat/test-Array.R:
##########
@@ -1321,3 +1321,19 @@ test_that("Array to C-interface", {
delete_arrow_schema(schema_ptr)
delete_arrow_array(array_ptr)
})
+
+test_that("direct creation of Decimal Arrays (ARROW-11631)", {
+
+ decimal_array <- Array$create(1, type = decimal128(10, 2))
+ decimal_array2 <- Array$create(1, type = decimal256(10, 2))
+
+ expect_equal(
Review Comment:
Hmm, interesting...I now get this result:
```
> Array$create(c(1:10, NA))$cast(decimal128(10, 2))
Error: Invalid: Precision is not great enough for the result. It should be
at least 12
/home/nic2/arrow/cpp/src/arrow/compute/exec.cc:828
kernel_->exec(kernel_ctx_, input, out)
/home/nic2/arrow/cpp/src/arrow/compute/exec.cc:796 ExecuteSingleSpan(input,
&output)
/home/nic2/arrow/cpp/src/arrow/compute/function.cc:276
executor->Execute(input, &listener)
```
Looks like a bug given 10 significant digits is more than enough to
represent the integers 1 through 10
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]