From c9a3b62944af6a486dfe1ca200645f8c77e8220a Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 6 Jun 2025 10:51:59 -0700 Subject: [PATCH 1/2] Revert manual edit of arrowExports.cpp --- r/src/arrowExports.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/r/src/arrowExports.cpp b/r/src/arrowExports.cpp index c71d1c773053..e75d38a303f6 100644 --- a/r/src/arrowExports.cpp +++ b/r/src/arrowExports.cpp @@ -1350,14 +1350,6 @@ BEGIN_CPP11 END_CPP11 } // compute.cpp -void compute__Initialize(); -extern "C" SEXP _arrow_compute__Initialize(){ -BEGIN_CPP11 - compute__Initialize(); - return R_NilValue; -END_CPP11 -} -// compute.cpp void RegisterScalarUDF(std::string name, cpp11::list func_sexp); extern "C" SEXP _arrow_RegisterScalarUDF(SEXP name_sexp, SEXP func_sexp_sexp){ BEGIN_CPP11 @@ -5813,7 +5805,6 @@ static const R_CallMethodDef CallEntries[] = { { "_arrow_Table__cast", (DL_FUNC) &_arrow_Table__cast, 3}, { "_arrow_compute__CallFunction", (DL_FUNC) &_arrow_compute__CallFunction, 3}, { "_arrow_compute__GetFunctionNames", (DL_FUNC) &_arrow_compute__GetFunctionNames, 0}, - { "_arrow_compute__Initialize", (DL_FUNC) &_arrow_compute__Initialize, 0}, { "_arrow_RegisterScalarUDF", (DL_FUNC) &_arrow_RegisterScalarUDF, 2}, { "_arrow_build_info", (DL_FUNC) &_arrow_build_info, 0}, { "_arrow_runtime_info", (DL_FUNC) &_arrow_runtime_info, 0}, @@ -6232,7 +6223,6 @@ extern "C" void R_init_arrow(DllInfo* dll){ arrow::r::altrep::Init_Altrep_classes(dll); #endif - _arrow_compute__Initialize(); } From 4566481b9d47cc31130ef41bdd0d3c98293af0c4 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 6 Jun 2025 11:13:38 -0700 Subject: [PATCH 2/2] Re-do R initialization change --- r/R/arrowExports.R | 4 ++++ r/data-raw/codegen.R | 3 +++ r/src/arrowExports.cpp | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/r/R/arrowExports.R b/r/R/arrowExports.R index 901898e5b29a..4ed612fc734b 100644 --- a/r/R/arrowExports.R +++ b/r/R/arrowExports.R @@ -536,6 +536,10 @@ compute__GetFunctionNames <- function() { .Call(`_arrow_compute__GetFunctionNames`) } +compute__Initialize <- function() { + invisible(.Call(`_arrow_compute__Initialize`)) +} + RegisterScalarUDF <- function(name, func_sexp) { invisible(.Call(`_arrow_RegisterScalarUDF`, name, func_sexp)) } diff --git a/r/data-raw/codegen.R b/r/data-raw/codegen.R index 4f027a3d9ddc..b8a0071cc420 100644 --- a/r/data-raw/codegen.R +++ b/r/data-raw/codegen.R @@ -191,6 +191,9 @@ static const R_CallMethodDef CallEntries[] = { arrow::r::altrep::Init_Altrep_classes(dll); #endif + #if ARROW_VERSION_MAJOR >= 21 + _arrow_compute__Initialize(); + #endif } \n' ) diff --git a/r/src/arrowExports.cpp b/r/src/arrowExports.cpp index e75d38a303f6..4301763e493a 100644 --- a/r/src/arrowExports.cpp +++ b/r/src/arrowExports.cpp @@ -1350,6 +1350,14 @@ BEGIN_CPP11 END_CPP11 } // compute.cpp +void compute__Initialize(); +extern "C" SEXP _arrow_compute__Initialize(){ +BEGIN_CPP11 + compute__Initialize(); + return R_NilValue; +END_CPP11 +} +// compute.cpp void RegisterScalarUDF(std::string name, cpp11::list func_sexp); extern "C" SEXP _arrow_RegisterScalarUDF(SEXP name_sexp, SEXP func_sexp_sexp){ BEGIN_CPP11 @@ -5805,6 +5813,7 @@ static const R_CallMethodDef CallEntries[] = { { "_arrow_Table__cast", (DL_FUNC) &_arrow_Table__cast, 3}, { "_arrow_compute__CallFunction", (DL_FUNC) &_arrow_compute__CallFunction, 3}, { "_arrow_compute__GetFunctionNames", (DL_FUNC) &_arrow_compute__GetFunctionNames, 0}, + { "_arrow_compute__Initialize", (DL_FUNC) &_arrow_compute__Initialize, 0}, { "_arrow_RegisterScalarUDF", (DL_FUNC) &_arrow_RegisterScalarUDF, 2}, { "_arrow_build_info", (DL_FUNC) &_arrow_build_info, 0}, { "_arrow_runtime_info", (DL_FUNC) &_arrow_runtime_info, 0}, @@ -6223,6 +6232,9 @@ extern "C" void R_init_arrow(DllInfo* dll){ arrow::r::altrep::Init_Altrep_classes(dll); #endif + #if ARROW_VERSION_MAJOR >= 21 + _arrow_compute__Initialize(); + #endif }