Skip to content
1 change: 1 addition & 0 deletions r/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map2_chr)
importFrom(purrr,map_chr)
importFrom(purrr,map_dbl)
importFrom(purrr,map_dfr)
importFrom(purrr,map_int)
importFrom(purrr,map_lgl)
Expand Down
2 changes: 1 addition & 1 deletion r/R/arrow-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#' @importFrom stats quantile median na.omit na.exclude na.pass na.fail
#' @importFrom R6 R6Class
#' @importFrom purrr as_mapper map map2 map_chr map2_chr map_dfr map_int map_lgl keep imap imap_chr flatten
#' @importFrom purrr as_mapper map map2 map_chr map2_chr map_dbl map_dfr map_int map_lgl keep imap imap_chr flatten
#' @importFrom assertthat assert_that is.string
#' @importFrom rlang list2 %||% is_false abort dots_n warn enquo quo_is_null enquos is_integerish quos
#' @importFrom rlang eval_tidy new_data_mask syms env new_environment env_bind set_names exec
Expand Down
4 changes: 2 additions & 2 deletions r/R/record-batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ rbind.RecordBatch <- function(...) {
}

cbind_check_length <- function(inputs, call = caller_env()) {
sizes <- map_int(inputs, NROW)
ok_lengths <- sizes %in% c(head(sizes, 1), 1L)
sizes <- map_dbl(inputs, NROW)
ok_lengths <- sizes %in% c(head(sizes, 1), 1)
if (!all(ok_lengths)) {
first_bad_one <- which.min(ok_lengths)
abort(
Expand Down
2 changes: 1 addition & 1 deletion r/R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ as_writable_table <- function(x) {
#' @keywords internal
recycle_scalars <- function(arrays) {
# Get lengths of items in arrays
arr_lens <- map_int(arrays, NROW)
arr_lens <- map_dbl(arrays, NROW)

is_scalar <- arr_lens == 1

Expand Down
24 changes: 12 additions & 12 deletions r/src/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,15 @@ int32_t ListArray__value_length(const std::shared_ptr<arrow::ListArray>& array,
}

// [[arrow::export]]
int64_t LargeListArray__value_length(const std::shared_ptr<arrow::LargeListArray>& array,
int64_t i) {
return array->value_length(i);
r_vec_size LargeListArray__value_length(
const std::shared_ptr<arrow::LargeListArray>& array, int64_t i) {
return r_vec_size(array->value_length(i));
}

// [[arrow::export]]
int64_t FixedSizeListArray__value_length(
r_vec_size FixedSizeListArray__value_length(
const std::shared_ptr<arrow::FixedSizeListArray>& array, int64_t i) {
return array->value_length(i);
return r_vec_size(array->value_length(i));
}

// [[arrow::export]]
Expand All @@ -262,15 +262,15 @@ int32_t ListArray__value_offset(const std::shared_ptr<arrow::ListArray>& array,
}

// [[arrow::export]]
int64_t LargeListArray__value_offset(const std::shared_ptr<arrow::LargeListArray>& array,
int64_t i) {
return array->value_offset(i);
r_vec_size LargeListArray__value_offset(
const std::shared_ptr<arrow::LargeListArray>& array, int64_t i) {
return r_vec_size(array->value_offset(i));
}

// [[arrow::export]]
int64_t FixedSizeListArray__value_offset(
r_vec_size FixedSizeListArray__value_offset(
const std::shared_ptr<arrow::FixedSizeListArray>& array, int64_t i) {
return array->value_offset(i);
return r_vec_size(array->value_offset(i));
}

// [[arrow::export]]
Expand Down Expand Up @@ -319,8 +319,8 @@ bool Array__Same(const std::shared_ptr<arrow::Array>& x,
}

// [[arrow::export]]
int64_t Array__ReferencedBufferSize(const std::shared_ptr<arrow::Array>& x) {
return ValueOrStop(arrow::util::ReferencedBufferSize(*x));
r_vec_size Array__ReferencedBufferSize(const std::shared_ptr<arrow::Array>& x) {
return r_vec_size(ValueOrStop(arrow::util::ReferencedBufferSize(*x)));
}

// [[arrow::export]]
Expand Down
54 changes: 27 additions & 27 deletions r/src/arrowExports.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions r/src/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ void Buffer__ZeroPadding(const std::shared_ptr<arrow::Buffer>& buffer) {
}

// [[arrow::export]]
int64_t Buffer__capacity(const std::shared_ptr<arrow::Buffer>& buffer) {
return buffer->capacity();
r_vec_size Buffer__capacity(const std::shared_ptr<arrow::Buffer>& buffer) {
return r_vec_size(buffer->capacity());
}

// [[arrow::export]]
int64_t Buffer__size(const std::shared_ptr<arrow::Buffer>& buffer) {
return buffer->size();
r_vec_size Buffer__size(const std::shared_ptr<arrow::Buffer>& buffer) {
return r_vec_size(buffer->size());
}

// [[arrow::export]]
Expand Down
19 changes: 11 additions & 8 deletions r/src/chunkedarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@
#include <arrow/util/byte_size.h>

// [[arrow::export]]
int ChunkedArray__length(const std::shared_ptr<arrow::ChunkedArray>& chunked_array) {
return chunked_array->length();
r_vec_size ChunkedArray__length(
const std::shared_ptr<arrow::ChunkedArray>& chunked_array) {
return r_vec_size(chunked_array->length());
}

// [[arrow::export]]
int ChunkedArray__null_count(const std::shared_ptr<arrow::ChunkedArray>& chunked_array) {
return chunked_array->null_count();
r_vec_size ChunkedArray__null_count(
const std::shared_ptr<arrow::ChunkedArray>& chunked_array) {
return r_vec_size(chunked_array->null_count());
}

// [[arrow::export]]
int ChunkedArray__num_chunks(const std::shared_ptr<arrow::ChunkedArray>& chunked_array) {
return chunked_array->num_chunks();
r_vec_size ChunkedArray__num_chunks(
const std::shared_ptr<arrow::ChunkedArray>& chunked_array) {
return r_vec_size(chunked_array->num_chunks());
}

// [[arrow::export]]
Expand Down Expand Up @@ -144,7 +147,7 @@ std::shared_ptr<arrow::ChunkedArray> ChunkedArray__from_list(cpp11::list chunks,
}

// [[arrow::export]]
int64_t ChunkedArray__ReferencedBufferSize(
r_vec_size ChunkedArray__ReferencedBufferSize(
const std::shared_ptr<arrow::ChunkedArray>& chunked_array) {
return ValueOrStop(arrow::util::ReferencedBufferSize(*chunked_array));
return r_vec_size(ValueOrStop(arrow::util::ReferencedBufferSize(*chunked_array)));
}
4 changes: 2 additions & 2 deletions r/src/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ std::shared_ptr<arrow::Table> dataset___Scanner__TakeRows(
}

// [[dataset::export]]
int64_t dataset___Scanner__CountRows(const std::shared_ptr<ds::Scanner>& scanner) {
return ValueOrStop(scanner->CountRows());
r_vec_size dataset___Scanner__CountRows(const std::shared_ptr<ds::Scanner>& scanner) {
return r_vec_size(ValueOrStop(scanner->CountRows()));
}

#endif
Loading