From 9e388130ca57a340a899d034a1b382d7e2ea1f39 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Tue, 14 Dec 2021 09:57:53 -0400 Subject: [PATCH 1/3] maybe fix sanitizer error on duration type --- r/src/arrowExports.cpp | 4 ++-- r/src/datatype.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/r/src/arrowExports.cpp b/r/src/arrowExports.cpp index cb0dc5097d4..ab2d55937f5 100644 --- a/r/src/arrowExports.cpp +++ b/r/src/arrowExports.cpp @@ -3020,10 +3020,10 @@ extern "C" SEXP _arrow_TimeType__unit(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) -arrow::TimeUnit::type DurationType__unit(const std::shared_ptr& type); +arrow::TimeUnit::type DurationType__unit(const std::shared_ptr& type); extern "C" SEXP _arrow_DurationType__unit(SEXP type_sexp){ BEGIN_CPP11 - arrow::r::Input&>::type type(type_sexp); + arrow::r::Input&>::type type(type_sexp); return cpp11::as_sexp(DurationType__unit(type)); END_CPP11 } diff --git a/r/src/datatype.cpp b/r/src/datatype.cpp index 17e4eafe824..c1b6626f89b 100644 --- a/r/src/datatype.cpp +++ b/r/src/datatype.cpp @@ -317,7 +317,7 @@ arrow::TimeUnit::type TimeType__unit(const std::shared_ptr& typ } // [[arrow::export]] -arrow::TimeUnit::type DurationType__unit(const std::shared_ptr& type) { +arrow::TimeUnit::type DurationType__unit(const std::shared_ptr& type) { return type->unit(); } From f494d894c6810abce76fc3e7ddd6afab4a94753b Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Tue, 14 Dec 2021 12:40:58 -0400 Subject: [PATCH 2/3] fix another reference to TimeType that should have been DurationType --- r/src/array_to_vector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/src/array_to_vector.cpp b/r/src/array_to_vector.cpp index 7cf861a5448..f834a88f1b5 100644 --- a/r/src/array_to_vector.cpp +++ b/r/src/array_to_vector.cpp @@ -886,7 +886,7 @@ class Converter_Time : public Converter { } }; -template +template class Converter_Duration : public Converter { public: explicit Converter_Duration(const std::shared_ptr& chunked_array) From 8a5faa6a97682967e04059848189e3769e30fadc Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Tue, 14 Dec 2021 15:16:32 -0400 Subject: [PATCH 3/3] fix clang-format linter --- r/src/datatype.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r/src/datatype.cpp b/r/src/datatype.cpp index c1b6626f89b..62933cccfcc 100644 --- a/r/src/datatype.cpp +++ b/r/src/datatype.cpp @@ -317,7 +317,8 @@ arrow::TimeUnit::type TimeType__unit(const std::shared_ptr& typ } // [[arrow::export]] -arrow::TimeUnit::type DurationType__unit(const std::shared_ptr& type) { +arrow::TimeUnit::type DurationType__unit( + const std::shared_ptr& type) { return type->unit(); }