Details
-
New Feature
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
6.0.0
Description
This is a C++ kernel issue, but the examples below use the R bindings to call the C++ kernels.
The aggregate functions tdigest and quantile return arrays with the same length as the option value q:
call_function("tdigest", Array$create(c(1, 2, 3, NA)), options = list(q = c(0.1, 0.9), skip_nulls = TRUE)) ## Array ## <double> ## [ ## 1, ## 3 ## ]
But when the data includes null values and the option skip_nulls is set to false, these kernels instead return zero-length arrays:
call_function("tdigest", Array$create(c(1, 2, 3, NA)), options = list(q = c(0.1, 0.9), skip_nulls = FALSE)) ## Array ## <double> ## []
This is difficult to handle in bindings; it requires addition of special code to handle the case where the array comes back empty. It would be much better if the returned array in this situation had the same length q with null in every position:
## Array ## <double> ## [ ## null, ## null ## ]
Attachments
Issue Links
- blocks
-
ARROW-13772 [R] Binding for median() and quantile() aggregation functions
- Resolved
- links to