You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/12 21:07:53 UTC

[GitHub] [arrow] ianmcook commented on a change in pull request #9170: ARROW-11176: [R] Expose memory pool name and document setting it

ianmcook commented on a change in pull request #9170:
URL: https://github.com/apache/arrow/pull/9170#discussion_r556072024



##########
File path: r/R/arrow-package.R
##########
@@ -76,6 +76,39 @@ option_use_threads <- function() {
   !is_false(getOption("arrow.use_threads"))
 }
 
+#' Report information on the package's capabilities
+#'
+#' This function summarizes a number of build-time configurations and run-time
+#' settings for the Arrow package. It may be useful for diagnostics.
+#' @return A list including version information, boolean "capabilities", and
+#' statistics from Arrow's memory allocator.
+#' @export
+#' @importFrom utils packageVersion
+arrow_info <- function() {
+  opts <- options()
+  out <- list(
+    version = packageVersion("arrow"),
+    libarrow = arrow_available(),
+    options = opts[grep("^arrow.", names(opts))]

Review comment:
       Escape the dot (`\\.`) to make it match only literal dots

##########
File path: r/R/arrow-package.R
##########
@@ -76,6 +76,39 @@ option_use_threads <- function() {
   !is_false(getOption("arrow.use_threads"))
 }
 
+#' Report information on the package's capabilities
+#'
+#' This function summarizes a number of build-time configurations and run-time
+#' settings for the Arrow package. It may be useful for diagnostics.
+#' @return A list including version information, boolean "capabilities", and
+#' statistics from Arrow's memory allocator.
+#' @export
+#' @importFrom utils packageVersion
+arrow_info <- function() {
+  opts <- options()
+  out <- list(
+    version = packageVersion("arrow"),

Review comment:
       `packageVersion()` returns a special object with classes `package_version` and `numeric_version`. It's probably fine, but there's a chance it might print weird in some user environments. Maybe safer to wrap it in `as.character()`?

##########
File path: r/NEWS.md
##########
@@ -35,6 +35,8 @@
 * Large string types can now be written to Parquet files
 * The [pronouns `.data` and `.env`](https://rlang.r-lib.org/reference/tidyeval-data.html) are now fully supported in Arrow `dplyr` pipelines.
 * Option `arrow.skip_nul` (default `FALSE`, as in `base::scan()`) allows conversion of Arrow string (`utf8()`) type data containing embedded nul `\0` characters to R. If set to `TRUE`, nuls will be stripped and a warning is emitted if any are found.
+* `arrow_info()` for an overview of various run-time and build-time Arrow configurations, useful for debugging
+* Set environment variable `ARROW_DEFAULT_MEMORY_POOL` before loading the Arrow package to change memory allocators. Windows packages are built with "mimalloc"; most others have "jemalloc". These are used by default if they were built, and they're generally much faster than the system malloc, but sometimes it is useful to turn them off for debugging purposes. To disable them, set `ARROW_DEFAULT_MEMORY_POOL=system`.

Review comment:
       Elsewhere in `NEWS.md`, `jemalloc` and `mimalloc` appear in backticks




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org