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
2 changes: 1 addition & 1 deletion dev/tasks/conda-recipes/r-arrow/configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euxo pipefail

# Remove the -I../inst/include/ when unvendoring cpp11 in ARROW-13610
echo "PKG_CPPFLAGS=-DNDEBUG -I\"${LIBRARY_PREFIX}/include\" -I\"${PREFIX}/include\" -DARROW_R_WITH_ARROW -DARROW_R_WITH_PARQUET -DARROW_R_WITH_DATASET -DARROW_R_WITH_S3 -I../inst/include/" > src/Makevars.win
echo "PKG_CPPFLAGS=-DNDEBUG -I\"${LIBRARY_PREFIX}/include\" -I\"${PREFIX}/include\" -DARROW_R_WITH_ARROW -DARROW_R_WITH_PARQUET -DARROW_R_WITH_DATASET -DARROW_R_WITH_S3 -DARROW_R_WITH_JSON -I../inst/include/" > src/Makevars.win
echo "PKG_CXXFLAGS=\$(CXX_VISIBILITY)" >> src/Makevars.win
echo 'CXX_STD=CXX11' >> src/Makevars.win
echo "PKG_LIBS=-L\"${LIBRARY_PREFIX}/lib\" -larrow_dataset -lparquet -larrow" >> src/Makevars.win
1 change: 1 addition & 0 deletions dev/tasks/r/azure.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
{{ flags|default("") }} \
-e ARROW_DATASET={{ arrow_dataset|default("") }} \
-e ARROW_PARQUET={{ arrow_parquet|default("") }} \
-e ARROW_JSON={{ arrow_json|default("") }} \
-e ARROW_S3={{ arrow_s3|default("") }} \
-e ARROW_WITH_RE2={{ arrow_with_re2|default("") }} \
-e ARROW_WITH_UTF8PROC={{ arrow_with_utf8proc|default("") }} \
Expand Down
1 change: 1 addition & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ tasks:
r_tag: latest
arrow_dataset: "OFF"
arrow_parquet: "OFF"
arrow_json: "OFF"
arrow_s3: "OFF"
arrow_with_re2: "OFF"
arrow_with_utf8proc: "OFF"
Expand Down
1 change: 1 addition & 0 deletions r/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export(UnionDataset)
export(arrow_available)
export(arrow_info)
export(arrow_with_dataset)
export(arrow_with_json)
export(arrow_with_parquet)
export(arrow_with_s3)
export(binary)
Expand Down
11 changes: 11 additions & 0 deletions r/R/arrow-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@
#' * The Arrow C++ library (check with `arrow_available()`)
#' * Arrow Dataset support enabled (check with `arrow_with_dataset()`)
#' * Parquet support enabled (check with `arrow_with_parquet()`)
#' * JSON support enabled (check with `arrow_with_json()`)
#' * Amazon S3 support enabled (check with `arrow_with_s3()`)
#' @export
#' @examples
#' arrow_available()
#' arrow_with_dataset()
#' arrow_with_parquet()
#' arrow_with_json()
#' arrow_with_s3()
#' @seealso If any of these are `FALSE`, see
#' `vignette("install", package = "arrow")` for guidance on reinstalling the
Expand Down Expand Up @@ -145,6 +147,14 @@ arrow_with_s3 <- function() {
})
}

#' @rdname arrow_available
#' @export
arrow_with_json <- function() {
tryCatch(.Call(`_json_available`), error = function(e) {
return(FALSE)
})
}

option_use_threads <- function() {
!is_false(getOption("arrow.use_threads"))
}
Expand Down Expand Up @@ -174,6 +184,7 @@ arrow_info <- function() {
capabilities = c(
dataset = arrow_with_dataset(),
parquet = arrow_with_parquet(),
json = arrow_with_json(),
s3 = arrow_with_s3(),
utf8proc = "utf8_upper" %in% compute_funcs,
re2 = "replace_substring_regex" %in% compute_funcs,
Expand Down
2 changes: 1 addition & 1 deletion r/R/json.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#'
#' @return A `data.frame`, or a Table if `as_data_frame = FALSE`.
#' @export
#' @examplesIf arrow_available()
#' @examplesIf arrow_with_json()
#' tf <- tempfile()
#' on.exit(unlink(tf))
#' writeLines('
Expand Down
5 changes: 5 additions & 0 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ if [ $? -eq 0 ]; then
BUNDLED_LIBS="$BUNDLED_LIBS -lssl -lcrypto -lcurl"
fi
fi
# Check for JSON
grep 'set(ARROW_JSON "ON")' $ARROW_OPTS_CMAKE >/dev/null 2>&1
if [ $? -eq 0 ]; then
PKG_CFLAGS="$PKG_CFLAGS -DARROW_R_WITH_JSON"
fi
# prepend PKG_DIRS and append BUNDLED_LIBS to PKG_LIBS
PKG_LIBS="$PKG_DIRS $PKG_LIBS $BUNDLED_LIBS"
echo "PKG_CFLAGS=$PKG_CFLAGS"
Expand Down
2 changes: 1 addition & 1 deletion r/configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ AWS_LIBS="-laws-cpp-sdk-config -laws-cpp-sdk-transfer -laws-cpp-sdk-identity-man

# NOTE: If you make changes to the libraries below, you should also change
# ci/scripts/r_windows_build.sh and ci/scripts/PKGBUILD
PKG_CFLAGS="-I${RWINLIB}/include -DARROW_STATIC -DPARQUET_STATIC -DARROW_DS_STATIC -DARROW_R_WITH_ARROW -DARROW_R_WITH_PARQUET -DARROW_R_WITH_DATASET"
PKG_CFLAGS="-I${RWINLIB}/include -DARROW_STATIC -DPARQUET_STATIC -DARROW_DS_STATIC -DARROW_R_WITH_ARROW -DARROW_R_WITH_PARQUET -DARROW_R_WITH_DATASET -DARROW_R_WITH_JSON"
PKG_LIBS="-L${RWINLIB}/lib"'$(subst gcc,,$(COMPILED_BY))$(R_ARCH) '"-L${RWINLIB}/lib"'$(R_ARCH)$(CRT) '"-lparquet -larrow_dataset -larrow -larrow_bundled_dependencies -lutf8proc -lthrift -lsnappy -lz -lzstd -llz4 -lole32 ${MIMALLOC_LIBS} ${OPENSSL_LIBS}"

# S3 and re2 support only for Rtools40 (i.e. R >= 4.0)
Expand Down
2 changes: 1 addition & 1 deletion r/data-raw/codegen.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# Ensure that all machines are sorting the same way
invisible(Sys.setlocale("LC_COLLATE", "C"))

features <- c("arrow", "dataset", "parquet", "s3")
features <- c("arrow", "dataset", "parquet", "s3", "json")

suppressPackageStartupMessages({
library(decor)
Expand Down
2 changes: 1 addition & 1 deletion r/inst/build_arrow_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
-DARROW_FILESYSTEM=ON \
-DARROW_JEMALLOC=${ARROW_JEMALLOC:-$ARROW_DEFAULT_PARAM} \
-DARROW_MIMALLOC=${ARROW_MIMALLOC:-ON} \
-DARROW_JSON=ON \
-DARROW_JSON=${ARROW_JSON:-ON} \
-DARROW_PARQUET=${ARROW_PARQUET:-ON} \
-DARROW_S3=${ARROW_S3:-$ARROW_DEFAULT_PARAM} \
-DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI:-$ARROW_DEFAULT_PARAM} \
Expand Down
5 changes: 5 additions & 0 deletions r/man/arrow_available.Rd

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

2 changes: 1 addition & 1 deletion r/man/read_json_arrow.Rd

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

Loading