From 3646d0f7498ea71f62126cd125453cdcda61714d Mon Sep 17 00:00:00 2001 From: anjakefala Date: Thu, 17 Oct 2024 13:22:55 -0700 Subject: [PATCH 1/2] Remove docstrings for construcotrs that are being changed in a seperate PR --- cpp/src/arrow/chunk_resolver.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cpp/src/arrow/chunk_resolver.h b/cpp/src/arrow/chunk_resolver.h index 20718677599a2..ab0e753d0040e 100644 --- a/cpp/src/arrow/chunk_resolver.h +++ b/cpp/src/arrow/chunk_resolver.h @@ -75,23 +75,12 @@ class ARROW_EXPORT ChunkResolver { mutable std::atomic cached_chunk_; public: - /// \brief Initialize from an `ArrayVector`. explicit ChunkResolver(const ArrayVector& chunks) noexcept; - /// \brief Initialize from a vector of raw `Array` pointers. explicit ChunkResolver(const std::vector& chunks) noexcept; - /// \brief Initialize from a `RecordBatchVector`. - /// - /// Because all `Array`s in a `RecordBatch` must have the same length, this - /// can be useful for iterating over multiple columns simultaneously. explicit ChunkResolver(const RecordBatchVector& batches) noexcept; - /// \brief Construct a ChunkResolver from a vector of chunks.size() + 1 offsets. - /// - /// The first offset must be 0 and the last offset must be the logical length of the - /// chunked array. Each offset before the last represents the starting logical index of - /// the corresponding chunk. explicit ChunkResolver(std::vector offsets) noexcept : offsets_(std::move(offsets)), cached_chunk_(0) { #ifndef NDEBUG From d2d29b0d77bc7b0bf98810daf3cba36c86fdc2d3 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Thu, 17 Oct 2024 20:57:23 +0000 Subject: [PATCH 2/2] Guard ChunkResolver use in altrep.cpp --- r/src/altrep.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/r/src/altrep.cpp b/r/src/altrep.cpp index 5c9c454aa7e76..5c95b634a0979 100644 --- a/r/src/altrep.cpp +++ b/r/src/altrep.cpp @@ -80,6 +80,14 @@ void DeletePointer(std::shared_ptr* ptr) { template using Pointer = cpp11::external_pointer, DeletePointer>; +#if ARROW_MAJOR_VERSION >= 18 +using ChunkResolver = arrow::ChunkResolver; +using ChunkLocation = arrow::ChunkLocation; +#else +using ChunkResolver = arrow::internal::ChunkResolver; +using ChunkLocation = arrow::internal::ChunkLocation; +#endif + class ArrowAltrepData { public: explicit ArrowAltrepData(const std::shared_ptr& chunked_array) @@ -87,11 +95,11 @@ class ArrowAltrepData { const std::shared_ptr& chunked_array() { return chunked_array_; } - arrow::ChunkLocation locate(int64_t index) { return resolver_.Resolve(index); } + ChunkLocation locate(int64_t index) { return resolver_.Resolve(index); } private: std::shared_ptr chunked_array_; - arrow::ChunkResolver resolver_; + ChunkResolver resolver_; }; // the ChunkedArray that is being wrapped by the altrep object