From 7be77e1a3c35411fddc0e7bfc1ff6e0245be7f0d Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Tue, 2 Jun 2020 20:12:18 -0500 Subject: [PATCH 1/2] Remove APIs that were marked as deprecated in 0.17.0 --- cpp/src/arrow/array/array_dict.cc | 19 ---- cpp/src/arrow/array/array_dict.h | 11 --- cpp/src/arrow/array/array_nested.cc | 21 ---- cpp/src/arrow/array/array_nested.h | 84 +--------------- cpp/src/arrow/array/util.cc | 20 ---- cpp/src/arrow/array/util.h | 38 -------- cpp/src/arrow/buffer.cc | 80 --------------- cpp/src/arrow/buffer.h | 58 ----------- cpp/src/arrow/extension_type.cc | 6 -- cpp/src/arrow/extension_type.h | 5 - cpp/src/arrow/filesystem/filesystem.h | 13 --- cpp/src/arrow/gpu/cuda_arrow_ipc.cc | 16 --- cpp/src/arrow/gpu/cuda_arrow_ipc.h | 33 ------- cpp/src/arrow/gpu/cuda_context.cc | 28 ------ cpp/src/arrow/gpu/cuda_context.h | 67 ------------- cpp/src/arrow/gpu/cuda_memory.cc | 23 ----- cpp/src/arrow/gpu/cuda_memory.h | 49 ---------- cpp/src/arrow/ipc/message.cc | 12 --- cpp/src/arrow/ipc/message.h | 35 ------- cpp/src/arrow/ipc/reader.cc | 81 ---------------- cpp/src/arrow/ipc/reader.h | 58 ----------- cpp/src/arrow/ipc/writer.cc | 108 --------------------- cpp/src/arrow/ipc/writer.h | 134 -------------------------- cpp/src/arrow/record_batch.cc | 27 ------ cpp/src/arrow/record_batch.h | 29 ------ cpp/src/arrow/table.cc | 55 ----------- cpp/src/arrow/table.h | 45 --------- cpp/src/arrow/type.cc | 19 ---- cpp/src/arrow/type.h | 16 --- 29 files changed, 1 insertion(+), 1189 deletions(-) diff --git a/cpp/src/arrow/array/array_dict.cc b/cpp/src/arrow/array/array_dict.cc index 68615a2b69d..1c5abf6e0d8 100644 --- a/cpp/src/arrow/array/array_dict.cc +++ b/cpp/src/arrow/array/array_dict.cc @@ -167,13 +167,6 @@ Result> DictionaryArray::FromArrays( return std::make_shared(type, indices, dictionary); } -Status DictionaryArray::FromArrays(const std::shared_ptr& type, - const std::shared_ptr& indices, - const std::shared_ptr& dictionary, - std::shared_ptr* out) { - return FromArrays(type, indices, dictionary).Value(out); -} - bool DictionaryArray::CanCompareIndices(const DictionaryArray& other) const { DCHECK(dictionary()->type()->Equals(other.dictionary()->type())) << "dictionaries have differing type " << *dictionary()->type() << " vs " @@ -287,11 +280,6 @@ Result> DictionaryUnifier::Make( return std::move(maker.result); } -Status DictionaryUnifier::Make(MemoryPool* pool, std::shared_ptr value_type, - std::unique_ptr* out) { - return Make(value_type, pool).Value(out); -} - // ---------------------------------------------------------------------- // DictionaryArray transposition @@ -392,11 +380,4 @@ Result> DictionaryArray::Transpose( #undef TRANSPOSE_IN_OUT_CASE } -Status DictionaryArray::Transpose(MemoryPool* pool, const std::shared_ptr& type, - const std::shared_ptr& dictionary, - const int32_t* transpose_map, - std::shared_ptr* out) const { - return Transpose(type, dictionary, transpose_map, pool).Value(out); -} - } // namespace arrow diff --git a/cpp/src/arrow/array/array_dict.h b/cpp/src/arrow/array/array_dict.h index d9ac44c1566..b00bd5d3528 100644 --- a/cpp/src/arrow/array/array_dict.h +++ b/cpp/src/arrow/array/array_dict.h @@ -76,12 +76,6 @@ class ARROW_EXPORT DictionaryArray : public Array { const std::shared_ptr& type, const std::shared_ptr& indices, const std::shared_ptr& dictionary); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromArrays(const std::shared_ptr& type, - const std::shared_ptr& indices, - const std::shared_ptr& dictionary, - std::shared_ptr* out); - /// \brief Transpose this DictionaryArray /// /// This method constructs a new dictionary array with the given dictionary type, @@ -98,11 +92,6 @@ class ARROW_EXPORT DictionaryArray : public Array { const std::shared_ptr& type, const std::shared_ptr& dictionary, const int32_t* transpose_map, MemoryPool* pool = default_memory_pool()) const; - ARROW_DEPRECATED("Use Result-returning version") - Status Transpose(MemoryPool* pool, const std::shared_ptr& type, - const std::shared_ptr& dictionary, const int32_t* transpose_map, - std::shared_ptr* out) const; - /// \brief Determine whether dictionary arrays may be compared without unification bool CanCompareIndices(const DictionaryArray& other) const; diff --git a/cpp/src/arrow/array/array_nested.cc b/cpp/src/arrow/array/array_nested.cc index cb3244f0d58..fa07694420a 100644 --- a/cpp/src/arrow/array/array_nested.cc +++ b/cpp/src/arrow/array/array_nested.cc @@ -250,16 +250,6 @@ Result> LargeListArray::FromArrays(const Array& offsets, return ListArrayFromArrays(offsets, values, pool); } -Status ListArray::FromArrays(const Array& offsets, const Array& values, MemoryPool* pool, - std::shared_ptr* out) { - return FromArrays(offsets, values, pool).Value(out); -} - -Status LargeListArray::FromArrays(const Array& offsets, const Array& values, - MemoryPool* pool, std::shared_ptr* out) { - return FromArrays(offsets, values, pool).Value(out); -} - Result> ListArray::Flatten(MemoryPool* memory_pool) const { return FlattenListArray(*this, memory_pool); } @@ -326,13 +316,6 @@ Result> MapArray::FromArrays(const std::shared_ptr offsets->offset()); } -Status MapArray::FromArrays(const std::shared_ptr& offsets, - const std::shared_ptr& keys, - const std::shared_ptr& items, MemoryPool* pool, - std::shared_ptr* out) { - return FromArrays(offsets, keys, items, pool).Value(out); -} - Status MapArray::ValidateChildData( const std::vector>& child_data) { if (child_data.size() != 1) { @@ -569,10 +552,6 @@ Result StructArray::Flatten(MemoryPool* pool) const { return flattened; } -Status StructArray::Flatten(MemoryPool* pool, ArrayVector* out) const { - return Flatten(pool).Value(out); -} - // ---------------------------------------------------------------------- // UnionArray diff --git a/cpp/src/arrow/array/array_nested.h b/cpp/src/arrow/array/array_nested.h index e8d72477fe8..607067cfdf0 100644 --- a/cpp/src/arrow/array/array_nested.h +++ b/cpp/src/arrow/array/array_nested.h @@ -105,10 +105,6 @@ class ARROW_EXPORT ListArray : public BaseListArray { const Array& offsets, const Array& values, MemoryPool* pool = default_memory_pool()); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromArrays(const Array& offsets, const Array& values, MemoryPool* pool, - std::shared_ptr* out); - /// \brief Return an Array that is a concatenation of the lists in this array. /// /// Note that it's different from `values()` in that it takes into @@ -151,10 +147,6 @@ class ARROW_EXPORT LargeListArray : public BaseListArray { const Array& offsets, const Array& values, MemoryPool* pool = default_memory_pool()); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromArrays(const Array& offsets, const Array& values, MemoryPool* pool, - std::shared_ptr* out); - /// \brief Return an Array that is a concatenation of the lists in this array. /// /// Note that it's different from `values()` in that it takes into @@ -208,12 +200,6 @@ class ARROW_EXPORT MapArray : public ListArray { const std::shared_ptr& offsets, const std::shared_ptr& keys, const std::shared_ptr& items, MemoryPool* pool = default_memory_pool()); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromArrays(const std::shared_ptr& offsets, - const std::shared_ptr& keys, - const std::shared_ptr& items, MemoryPool* pool, - std::shared_ptr* out); - const MapType* map_type() const { return map_type_; } /// \brief Return array object containing all map keys @@ -336,9 +322,6 @@ class ARROW_EXPORT StructArray : public Array { /// \param[in] pool The pool to allocate null bitmaps from, if necessary Result Flatten(MemoryPool* pool = default_memory_pool()) const; - ARROW_DEPRECATED("Use Result-returning version") - Status Flatten(MemoryPool* pool, ArrayVector* out) const; - private: // For caching boxed child data // XXX This is not handled in a thread-safe manner. @@ -401,39 +384,6 @@ class ARROW_EXPORT UnionArray : public Array { type_codes); } - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeDense(const Array& type_ids, const Array& value_offsets, - const std::vector>& children, - const std::vector& field_names, - const std::vector& type_codes, - std::shared_ptr* out) { - return MakeDense(type_ids, value_offsets, children, field_names, type_codes) - .Value(out); - } - - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeDense(const Array& type_ids, const Array& value_offsets, - const std::vector>& children, - const std::vector& field_names, - std::shared_ptr* out) { - return MakeDense(type_ids, value_offsets, children, field_names).Value(out); - } - - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeDense(const Array& type_ids, const Array& value_offsets, - const std::vector>& children, - const std::vector& type_codes, - std::shared_ptr* out) { - return MakeDense(type_ids, value_offsets, children, type_codes).Value(out); - } - - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeDense(const Array& type_ids, const Array& value_offsets, - const std::vector>& children, - std::shared_ptr* out) { - return MakeDense(type_ids, value_offsets, children).Value(out); - } - /// \brief Construct Sparse UnionArray from type_ids and children /// /// This function does the bare minimum of validation of the offsets and @@ -462,38 +412,6 @@ class ARROW_EXPORT UnionArray : public Array { return MakeSparse(type_ids, children, std::vector{}, type_codes); } - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeSparse(const Array& type_ids, - const std::vector>& children, - const std::vector& field_names, - const std::vector& type_codes, - std::shared_ptr* out) { - return MakeSparse(type_ids, children, field_names, type_codes).Value(out); - } - - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeSparse(const Array& type_ids, - const std::vector>& children, - const std::vector& field_names, - std::shared_ptr* out) { - return MakeSparse(type_ids, children, field_names).Value(out); - } - - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeSparse(const Array& type_ids, - const std::vector>& children, - const std::vector& type_codes, - std::shared_ptr* out) { - return MakeSparse(type_ids, children, type_codes).Value(out); - } - - ARROW_DEPRECATED("Use Result-returning version") - static Status MakeSparse(const Array& type_ids, - const std::vector>& children, - std::shared_ptr* out) { - return MakeSparse(type_ids, children).Value(out); - } - /// Note that this buffer does not account for any slice offset std::shared_ptr type_codes() const { return data_->buffers[1]; } @@ -521,7 +439,7 @@ class ARROW_EXPORT UnionArray : public Array { // Return the given field as an individual array. // For sparse unions, the returned array has its offset, length and null // count adjusted. - ARROW_DEPRECATED("Use field(pos)") + ARROW_DEPRECATED("Deprecated in 1.0.0. Use field(pos)") std::shared_ptr child(int pos) const; /// \brief Return the given field as an individual array. diff --git a/cpp/src/arrow/array/util.cc b/cpp/src/arrow/array/util.cc index c771b1fcff0..a0312e308ec 100644 --- a/cpp/src/arrow/array/util.cc +++ b/cpp/src/arrow/array/util.cc @@ -387,26 +387,6 @@ Result> MakeArrayFromScalar(const Scalar& scalar, int64_t return internal::RepeatedArrayFactory(pool, scalar, length).Create(); } -Status MakeArrayOfNull(MemoryPool* pool, const std::shared_ptr& type, - int64_t length, std::shared_ptr* out) { - return MakeArrayOfNull(type, length, pool).Value(out); -} - -Status MakeArrayOfNull(const std::shared_ptr& type, int64_t length, - std::shared_ptr* out) { - return MakeArrayOfNull(type, length).Value(out); -} - -Status MakeArrayFromScalar(MemoryPool* pool, const Scalar& scalar, int64_t length, - std::shared_ptr* out) { - return MakeArrayFromScalar(scalar, length, pool).Value(out); -} - -Status MakeArrayFromScalar(const Scalar& scalar, int64_t length, - std::shared_ptr* out) { - return MakeArrayFromScalar(scalar, length).Value(out); -} - namespace internal { std::vector RechunkArraysConsistently( diff --git a/cpp/src/arrow/array/util.h b/cpp/src/arrow/array/util.h index 6d58cfa5b2d..b400255c18e 100644 --- a/cpp/src/arrow/array/util.h +++ b/cpp/src/arrow/array/util.h @@ -54,44 +54,6 @@ ARROW_EXPORT Result> MakeArrayFromScalar( const Scalar& scalar, int64_t length, MemoryPool* pool = default_memory_pool()); -/// \brief Create a strongly-typed Array instance with all elements null -/// \param[in] type the array type -/// \param[in] length the array length -/// \param[out] out resulting Array instance -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status MakeArrayOfNull(const std::shared_ptr& type, int64_t length, - std::shared_ptr* out); - -/// \brief Create a strongly-typed Array instance with all elements null -/// \param[in] pool the pool from which memory for this array will be allocated -/// \param[in] type the array type -/// \param[in] length the array length -/// \param[out] out resulting Array instance -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status MakeArrayOfNull(MemoryPool* pool, const std::shared_ptr& type, - int64_t length, std::shared_ptr* out); - -/// \brief Create an Array instance whose slots are the given scalar -/// \param[in] scalar the value with which to fill the array -/// \param[in] length the array length -/// \param[out] out resulting Array instance -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status MakeArrayFromScalar(const Scalar& scalar, int64_t length, - std::shared_ptr* out); - -/// \brief Create a strongly-typed Array instance with all elements null -/// \param[in] pool the pool from which memory for this array will be allocated -/// \param[in] scalar the value with which to fill the array -/// \param[in] length the array length -/// \param[out] out resulting Array instance -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status MakeArrayFromScalar(MemoryPool* pool, const Scalar& scalar, int64_t length, - std::shared_ptr* out); - namespace internal { /// Given a number of ArrayVectors, treat each ArrayVector as the diff --git a/cpp/src/arrow/buffer.cc b/cpp/src/arrow/buffer.cc index 136dbc7fe54..2f7917a11c3 100644 --- a/cpp/src/arrow/buffer.cc +++ b/cpp/src/arrow/buffer.cc @@ -42,16 +42,6 @@ Result> Buffer::CopySlice(const int64_t start, return std::move(new_buffer); } -Status Buffer::Copy(const int64_t start, const int64_t nbytes, MemoryPool* pool, - std::shared_ptr* out) const { - return CopySlice(start, nbytes, pool).Value(out); -} - -Status Buffer::Copy(const int64_t start, const int64_t nbytes, - std::shared_ptr* out) const { - return CopySlice(start, nbytes).Value(out); -} - std::string Buffer::ToHexString() { return HexEncode(data(), static_cast(size())); } @@ -68,24 +58,6 @@ bool Buffer::Equals(const Buffer& other) const { !memcmp(data_, other.data_, static_cast(size_)))); } -static Status BufferFromString(const std::string& data, MemoryPool* pool, - std::shared_ptr* out) { - auto size = static_cast(data.size()); - ARROW_ASSIGN_OR_RAISE(auto buf, AllocateBuffer(size, pool)); - std::copy(data.c_str(), data.c_str() + size, buf->mutable_data()); - *out = std::move(buf); - return Status::OK(); -} - -Status Buffer::FromString(const std::string& data, MemoryPool* pool, - std::shared_ptr* out) { - return BufferFromString(data, pool, out); -} - -Status Buffer::FromString(const std::string& data, std::shared_ptr* out) { - return BufferFromString(data, default_memory_pool(), out); -} - std::string Buffer::ToString() const { return std::string(reinterpret_cast(data_), static_cast(size_)); } @@ -256,69 +228,22 @@ Result> AllocateBuffer(const int64_t size, MemoryPool* p return ResizePoolBuffer>(PoolBuffer::MakeUnique(pool), size); } -Status AllocateBuffer(MemoryPool* pool, const int64_t size, - std::shared_ptr* out) { - return AllocateBuffer(size, pool).Value(out); -} - -Status AllocateBuffer(const int64_t size, std::shared_ptr* out) { - return AllocateBuffer(size).Value(out); -} - -Status AllocateBuffer(MemoryPool* pool, const int64_t size, - std::unique_ptr* out) { - return AllocateBuffer(size, pool).Value(out); -} - -Status AllocateBuffer(const int64_t size, std::unique_ptr* out) { - return AllocateBuffer(size).Value(out); -} - Result> AllocateResizableBuffer(const int64_t size, MemoryPool* pool) { return ResizePoolBuffer>(PoolBuffer::MakeUnique(pool), size); } -Status AllocateResizableBuffer(MemoryPool* pool, const int64_t size, - std::shared_ptr* out) { - return AllocateResizableBuffer(size, pool).Value(out); -} - -Status AllocateResizableBuffer(const int64_t size, - std::shared_ptr* out) { - return AllocateResizableBuffer(size).Value(out); -} - -Status AllocateResizableBuffer(MemoryPool* pool, const int64_t size, - std::unique_ptr* out) { - return AllocateResizableBuffer(size, pool).Value(out); -} - -Status AllocateResizableBuffer(const int64_t size, - std::unique_ptr* out) { - return AllocateResizableBuffer(size).Value(out); -} - Result> AllocateBitmap(int64_t length, MemoryPool* pool) { return AllocateBuffer(BitUtil::BytesForBits(length), pool); } -Status AllocateBitmap(MemoryPool* pool, int64_t length, std::shared_ptr* out) { - return AllocateBitmap(length, pool).Value(out); -} - Result> AllocateEmptyBitmap(int64_t length, MemoryPool* pool) { ARROW_ASSIGN_OR_RAISE(auto buf, AllocateBitmap(length, pool)); memset(buf->mutable_data(), 0, static_cast(buf->size())); return buf; } -Status AllocateEmptyBitmap(MemoryPool* pool, int64_t length, - std::shared_ptr* out) { - return AllocateEmptyBitmap(length, pool).Value(out); -} - Status AllocateEmptyBitmap(int64_t length, std::shared_ptr* out) { return AllocateEmptyBitmap(length).Value(out); } @@ -338,9 +263,4 @@ Result> ConcatenateBuffers( return std::move(out); } -Status ConcatenateBuffers(const std::vector>& buffers, - MemoryPool* pool, std::shared_ptr* out) { - return ConcatenateBuffers(buffers, pool).Value(out); -} - } // namespace arrow diff --git a/cpp/src/arrow/buffer.h b/cpp/src/arrow/buffer.h index 59b0a6818d4..68a8b05afb9 100644 --- a/cpp/src/arrow/buffer.h +++ b/cpp/src/arrow/buffer.h @@ -124,14 +124,6 @@ class ARROW_EXPORT Buffer { const int64_t start, const int64_t nbytes, MemoryPool* pool = default_memory_pool()) const; - ARROW_DEPRECATED("Use CopySlice") - Status Copy(const int64_t start, const int64_t nbytes, MemoryPool* pool, - std::shared_ptr* out) const; - - ARROW_DEPRECATED("Use CopySlice") - Status Copy(const int64_t start, const int64_t nbytes, - std::shared_ptr* out) const; - /// Zero bytes in padding, i.e. bytes between size_ and capacity_. void ZeroPadding() { #ifndef NDEBUG @@ -150,13 +142,6 @@ class ARROW_EXPORT Buffer { /// \return a new Buffer instance static std::shared_ptr FromString(std::string data); - ARROW_DEPRECATED("Use Buffer-returning version") - static Status FromString(const std::string& data, MemoryPool* pool, - std::shared_ptr* out); - - ARROW_DEPRECATED("Use Buffer-returning version") - static Status FromString(const std::string& data, std::shared_ptr* out); - /// \brief Create buffer referencing typed memory with some length without /// copying /// \param[in] data the typed memory as C array @@ -450,22 +435,6 @@ ARROW_EXPORT Result> AllocateBuffer(const int64_t size, MemoryPool* pool = NULLPTR); -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateBuffer(MemoryPool* pool, const int64_t size, std::shared_ptr* out); - -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateBuffer(const int64_t size, std::shared_ptr* out); - -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateBuffer(MemoryPool* pool, const int64_t size, std::unique_ptr* out); - -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateBuffer(const int64_t size, std::unique_ptr* out); - /// \brief Allocate a resizeable buffer from a memory pool, zero its padding. /// /// \param[in] size size of buffer to allocate @@ -474,24 +443,6 @@ ARROW_EXPORT Result> AllocateResizableBuffer( const int64_t size, MemoryPool* pool = NULLPTR); -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateResizableBuffer(MemoryPool* pool, const int64_t size, - std::shared_ptr* out); - -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateResizableBuffer(const int64_t size, std::shared_ptr* out); - -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateResizableBuffer(MemoryPool* pool, const int64_t size, - std::unique_ptr* out); - -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateResizableBuffer(const int64_t size, std::unique_ptr* out); - /// \brief Allocate a bitmap buffer from a memory pool /// no guarantee on values is provided. /// @@ -512,15 +463,6 @@ ARROW_EXPORT Result> AllocateEmptyBitmap(int64_t length, MemoryPool* pool = NULLPTR); -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateEmptyBitmap(MemoryPool* pool, int64_t length, - std::shared_ptr* out); - -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateEmptyBitmap(int64_t length, std::shared_ptr* out); - /// \brief Concatenate multiple buffers into a single buffer /// /// \param[in] buffers to be concatenated diff --git a/cpp/src/arrow/extension_type.cc b/cpp/src/arrow/extension_type.cc index 74c631c4778..23bb30955b2 100644 --- a/cpp/src/arrow/extension_type.cc +++ b/cpp/src/arrow/extension_type.cc @@ -42,12 +42,6 @@ std::string ExtensionType::ToString() const { return ss.str(); } -Status ExtensionType::Deserialize(std::shared_ptr storage_type, - const std::string& serialized_data, - std::shared_ptr* out) const { - return Deserialize(std::move(storage_type), serialized_data).Value(out); -} - ExtensionArray::ExtensionArray(const std::shared_ptr& data) { SetData(data); } ExtensionArray::ExtensionArray(const std::shared_ptr& type, diff --git a/cpp/src/arrow/extension_type.h b/cpp/src/arrow/extension_type.h index ce65454ce11..ef7205eb058 100644 --- a/cpp/src/arrow/extension_type.h +++ b/cpp/src/arrow/extension_type.h @@ -74,11 +74,6 @@ class ARROW_EXPORT ExtensionType : public DataType { std::shared_ptr storage_type, const std::string& serialized_data) const = 0; - ARROW_DEPRECATED("Use Result-returning version") - Status Deserialize(std::shared_ptr storage_type, - const std::string& serialized_data, - std::shared_ptr* out) const; - /// \brief Create a serialized representation of the extension type's /// metadata. The storage type will be handled automatically in IPC code /// paths diff --git a/cpp/src/arrow/filesystem/filesystem.h b/cpp/src/arrow/filesystem/filesystem.h index fae8a408721..5aafa82b061 100644 --- a/cpp/src/arrow/filesystem/filesystem.h +++ b/cpp/src/arrow/filesystem/filesystem.h @@ -135,7 +135,6 @@ struct ARROW_EXPORT FileInfo : public util::EqualityComparable { int64_t size_ = kNoSize; TimePoint mtime_ = kNoTime; }; -using FileStats ARROW_DEPRECATED_USING("Use FileInfo") = struct FileInfo; ARROW_EXPORT std::ostream& operator<<(std::ostream& os, const FileInfo&); @@ -380,17 +379,5 @@ Result> FileSystemFromUriOrPath( /// @} -/// \brief Create a new FileSystem by URI -/// -/// Recognized schemes are "file", "mock", "hdfs" and "s3fs". -/// -/// \param[in] uri a URI-based path, ex: file:///some/local/path -/// \param[out] out_fs FileSystem instance. -/// \param[out] out_path (optional) Path inside the filesystem. -/// \return Status -ARROW_DEPRECATED("Use Result-returning version") -Status FileSystemFromUri(const std::string& uri, std::shared_ptr* out_fs, - std::string* out_path = NULLPTR); - } // namespace fs } // namespace arrow diff --git a/cpp/src/arrow/gpu/cuda_arrow_ipc.cc b/cpp/src/arrow/gpu/cuda_arrow_ipc.cc index 7ffcae05478..435696a7871 100644 --- a/cpp/src/arrow/gpu/cuda_arrow_ipc.cc +++ b/cpp/src/arrow/gpu/cuda_arrow_ipc.cc @@ -49,16 +49,6 @@ Result> SerializeRecordBatch(const RecordBatch& batc return CudaBuffer::FromBuffer(buf); } -Status SerializeRecordBatch(const RecordBatch& batch, CudaContext* ctx, - std::shared_ptr* out) { - return SerializeRecordBatch(batch, ctx).Value(out); -} - -Status ReadMessage(CudaBufferReader* reader, MemoryPool* pool, - std::unique_ptr* out) { - return ipc::ReadMessage(reader, pool).Value(out); -} - Result> ReadRecordBatch( const std::shared_ptr& schema, const std::shared_ptr& buffer, MemoryPool* pool) { @@ -76,11 +66,5 @@ Result> ReadRecordBatch( ipc::IpcReadOptions::Defaults()); } -Status ReadRecordBatch(const std::shared_ptr& schema, - const std::shared_ptr& buffer, MemoryPool* pool, - std::shared_ptr* out) { - return ReadRecordBatch(schema, buffer, pool).Value(out); -} - } // namespace cuda } // namespace arrow diff --git a/cpp/src/arrow/gpu/cuda_arrow_ipc.h b/cpp/src/arrow/gpu/cuda_arrow_ipc.h index f767abf891f..e6a207cfdc1 100644 --- a/cpp/src/arrow/gpu/cuda_arrow_ipc.h +++ b/cpp/src/arrow/gpu/cuda_arrow_ipc.h @@ -64,38 +64,5 @@ Result> ReadRecordBatch( /// @} -/// \brief Write record batch message to GPU device memory -/// \param[in] batch record batch to write -/// \param[in] ctx CudaContext to allocate device memory from -/// \param[out] out the returned device buffer which contains the record batch message -/// \return Status -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status SerializeRecordBatch(const RecordBatch& batch, CudaContext* ctx, - std::shared_ptr* out); - -/// \brief Read Arrow IPC message located on GPU device -/// \param[in] reader a CudaBufferReader -/// \param[in] pool a MemoryPool to allocate CPU memory for the metadata -/// \param[out] message the deserialized message, body still on device -/// -/// This function reads the message metadata into host memory, but leaves the -/// message body on the device -ARROW_DEPRECATED("Use arrow::ipc::ReadMessage") -ARROW_EXPORT -Status ReadMessage(CudaBufferReader* reader, MemoryPool* pool, - std::unique_ptr* message); - -/// \brief ReadRecordBatch specialized to handle metadata on CUDA device -/// \param[in] schema the Schema for the record batch -/// \param[in] buffer a CudaBuffer containing the complete IPC message -/// \param[in] pool a MemoryPool to use for allocating space for the metadata -/// \param[out] out the reconstructed RecordBatch, with device pointers -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status ReadRecordBatch(const std::shared_ptr& schema, - const std::shared_ptr& buffer, MemoryPool* pool, - std::shared_ptr* out); - } // namespace cuda } // namespace arrow diff --git a/cpp/src/arrow/gpu/cuda_context.cc b/cpp/src/arrow/gpu/cuda_context.cc index 99a3b4e5081..456d3344323 100644 --- a/cpp/src/arrow/gpu/cuda_context.cc +++ b/cpp/src/arrow/gpu/cuda_context.cc @@ -495,10 +495,6 @@ Result CudaDeviceManager::Instance() { return instance_.get(); } -Status CudaDeviceManager::GetInstance(CudaDeviceManager** manager) { - return Instance().Value(manager); -} - Result> CudaDeviceManager::GetDevice(int device_number) { return impl_->GetDevice(device_number); } @@ -507,21 +503,11 @@ Result> CudaDeviceManager::GetContext(int device_nu return impl_->GetContext(device_number); } -Status CudaDeviceManager::GetContext(int device_number, - std::shared_ptr* out) { - return impl_->GetContext(device_number).Value(out); -} - Result> CudaDeviceManager::GetSharedContext( int device_number, void* ctx) { return impl_->GetSharedContext(device_number, ctx); } -Status CudaDeviceManager::GetSharedContext(int device_number, void* ctx, - std::shared_ptr* out) { - return impl_->GetSharedContext(device_number, ctx).Value(out); -} - Result> CudaDeviceManager::AllocateHost(int device_number, int64_t nbytes) { uint8_t* data = nullptr; @@ -529,11 +515,6 @@ Result> CudaDeviceManager::AllocateHost(int devi return std::make_shared(data, nbytes); } -Status CudaDeviceManager::AllocateHost(int device_number, int64_t nbytes, - std::shared_ptr* out) { - return AllocateHost(device_number, nbytes).Value(out); -} - Status CudaDeviceManager::FreeHost(void* data, int64_t nbytes) { return impl_->FreeHost(data, nbytes); } @@ -553,19 +534,10 @@ Result> CudaContext::Allocate(int64_t nbytes) { return std::make_shared(data, nbytes, this->shared_from_this(), true); } -Status CudaContext::Allocate(int64_t nbytes, std::shared_ptr* out) { - return Allocate(nbytes).Value(out); -} - Result> CudaContext::View(uint8_t* data, int64_t nbytes) { return std::make_shared(data, nbytes, this->shared_from_this(), false); } -Status CudaContext::View(uint8_t* data, int64_t nbytes, - std::shared_ptr* out) { - return View(data, nbytes).Value(out); -} - Result> CudaContext::ExportIpcBuffer(void* data, int64_t size) { return impl_->ExportIpcBuffer(data, size); diff --git a/cpp/src/arrow/gpu/cuda_context.h b/cpp/src/arrow/gpu/cuda_context.h index 0fb4dd44adf..246883c9b99 100644 --- a/cpp/src/arrow/gpu/cuda_context.h +++ b/cpp/src/arrow/gpu/cuda_context.h @@ -43,9 +43,6 @@ class ARROW_EXPORT CudaDeviceManager { public: static Result Instance(); - ARROW_DEPRECATED("Use Instance()") - static Status GetInstance(CudaDeviceManager** manager); - /// \brief Get a CudaDevice instance for a particular device /// \param[in] device_number the CUDA device number Result> GetDevice(int device_number); @@ -55,40 +52,18 @@ class ARROW_EXPORT CudaDeviceManager { /// \return cached context Result> GetContext(int device_number); - /// \brief Get the CUDA driver context for a particular device - /// \param[in] device_number the CUDA device number - /// \param[out] out cached context - ARROW_DEPRECATED("Use Result-returning version") - Status GetContext(int device_number, std::shared_ptr* out); - /// \brief Get the shared CUDA driver context for a particular device /// \param[in] device_number the CUDA device number /// \param[in] handle CUDA context handle created by another library /// \return shared context Result> GetSharedContext(int device_number, void* handle); - /// \brief Get the shared CUDA driver context for a particular device - /// \param[in] device_number the CUDA device number - /// \param[in] handle CUDA context handle created by another library - /// \param[out] out shared context - ARROW_DEPRECATED("Use Result-returning version") - Status GetSharedContext(int device_number, void* handle, - std::shared_ptr* out); - /// \brief Allocate host memory with fast access to given GPU device /// \param[in] device_number the CUDA device number /// \param[in] nbytes number of bytes /// \return Host buffer or Status Result> AllocateHost(int device_number, int64_t nbytes); - /// \brief Allocate host memory with fast access to given GPU device - /// \param[in] device_number the CUDA device number - /// \param[in] nbytes number of bytes - /// \param[out] out the allocated buffer - ARROW_DEPRECATED("Use Result-returning version") - Status AllocateHost(int device_number, int64_t nbytes, - std::shared_ptr* out); - /// \brief Free host memory /// /// The given memory pointer must have been allocated with AllocateHost. @@ -244,13 +219,6 @@ class ARROW_EXPORT CudaContext : public std::enable_shared_from_this> Allocate(int64_t nbytes); - /// \brief Allocate CUDA memory on GPU device for this context - /// \param[in] nbytes number of bytes - /// \param[out] out the allocated buffer - /// \return Status - ARROW_DEPRECATED("Use Result-returning version") - Status Allocate(int64_t nbytes, std::shared_ptr* out); - /// \brief Release CUDA memory on GPU device for this context /// \param[in] device_ptr the buffer address /// \param[in] nbytes number of bytes @@ -267,31 +235,11 @@ class ARROW_EXPORT CudaContext : public std::enable_shared_from_this> View(uint8_t* data, int64_t nbytes); - /// \brief Create a view of CUDA memory on GPU device of this context - /// \param[in] data the starting device address - /// \param[in] nbytes number of bytes - /// \param[out] out the view buffer - /// \return Status - /// - /// \note The caller is responsible for allocating and freeing the - /// memory as well as ensuring that the memory belongs to the CUDA - /// context that this CudaContext instance holds. - ARROW_DEPRECATED("Use Result-returning version") - Status View(uint8_t* data, int64_t nbytes, std::shared_ptr* out); - /// \brief Open existing CUDA IPC memory handle /// \param[in] ipc_handle opaque pointer to CUipcMemHandle (driver API) /// \return a CudaBuffer referencing the IPC segment Result> OpenIpcBuffer(const CudaIpcMemHandle& ipc_handle); - /// \brief Open existing CUDA IPC memory handle - /// \param[in] ipc_handle opaque pointer to CUipcMemHandle (driver API) - /// \param[out] out a CudaBuffer referencing the IPC segment - /// \return Status - ARROW_DEPRECATED("Use Result-returning version") - Status OpenIpcBuffer(const CudaIpcMemHandle& ipc_handle, - std::shared_ptr* out); - /// \brief Close memory mapped with IPC buffer /// \param[in] buffer a CudaBuffer referencing /// \return Status @@ -328,21 +276,6 @@ class ARROW_EXPORT CudaContext : public std::enable_shared_from_this GetDeviceAddress(uint8_t* addr); Result GetDeviceAddress(uintptr_t addr); - /// \brief Return the device address that is reachable from kernels - /// running in the context - /// \param[in] addr device or host memory address - /// \param[out] devaddr the device address - /// \return Status - /// - /// The device address is defined as a memory address accessible by - /// device. While it is often a device memory address, it can be - /// also a host memory address, for instance, when the memory is - /// allocated as host memory (using cudaMallocHost or cudaHostAlloc) - /// or as managed memory (using cudaMallocManaged) or the host - /// memory is page-locked (using cudaHostRegister). - ARROW_DEPRECATED("Use Result-returning version") - Status GetDeviceAddress(uint8_t* addr, uint8_t** devaddr); - private: CudaContext(); diff --git a/cpp/src/arrow/gpu/cuda_memory.cc b/cpp/src/arrow/gpu/cuda_memory.cc index a33511d5933..80304d44cfd 100644 --- a/cpp/src/arrow/gpu/cuda_memory.cc +++ b/cpp/src/arrow/gpu/cuda_memory.cc @@ -76,11 +76,6 @@ Result> CudaIpcMemHandle::FromBuffer( return std::shared_ptr(new CudaIpcMemHandle(opaque_handle)); } -Status CudaIpcMemHandle::FromBuffer(const void* opaque_handle, - std::shared_ptr* handle) { - return FromBuffer(opaque_handle).Value(handle); -} - Result> CudaIpcMemHandle::Serialize(MemoryPool* pool) const { int64_t size = impl_->memory_size; const size_t handle_size = @@ -96,10 +91,6 @@ Result> CudaIpcMemHandle::Serialize(MemoryPool* pool) co return std::move(buffer); } -Status CudaIpcMemHandle::Serialize(MemoryPool* pool, std::shared_ptr* out) const { - return Serialize(pool).Value(out); -} - const void* CudaIpcMemHandle::handle() const { return &impl_->ipc_handle; } int64_t CudaIpcMemHandle::memory_size() const { return impl_->memory_size; } @@ -170,11 +161,6 @@ Result> CudaBuffer::FromBuffer( return cuda_buffer; } -Status CudaBuffer::FromBuffer(std::shared_ptr buffer, - std::shared_ptr* out) { - return FromBuffer(std::move(buffer)).Value(out); -} - Status CudaBuffer::CopyToHost(const int64_t position, const int64_t nbytes, void* out) const { return context_->CopyDeviceToHost(out, data_ + position, nbytes); @@ -215,10 +201,6 @@ Result> CudaBuffer::ExportForIpc() { return handle; } -Status CudaBuffer::ExportForIpc(std::shared_ptr* handle) { - return ExportForIpc().Value(handle); -} - CudaHostBuffer::~CudaHostBuffer() { auto maybe_manager = CudaDeviceManager::Instance(); ARROW_CHECK_OK(maybe_manager.status()); @@ -482,11 +464,6 @@ Result> AllocateCudaHostBuffer(int device_number return manager->AllocateHost(device_number, size); } -Status AllocateCudaHostBuffer(int device_number, const int64_t size, - std::shared_ptr* out) { - return AllocateCudaHostBuffer(device_number, size).Value(out); -} - Result GetDeviceAddress(const uint8_t* cpu_data, const std::shared_ptr& ctx) { ContextSaver context_saver(*ctx); diff --git a/cpp/src/arrow/gpu/cuda_memory.h b/cpp/src/arrow/gpu/cuda_memory.h index dee1211a492..4efd3889407 100644 --- a/cpp/src/arrow/gpu/cuda_memory.h +++ b/cpp/src/arrow/gpu/cuda_memory.h @@ -56,17 +56,6 @@ class ARROW_EXPORT CudaBuffer : public Buffer { /// by GPU memory static Result> FromBuffer(std::shared_ptr buffer); - /// \brief Convert back generic buffer into CudaBuffer - /// \param[in] buffer buffer to convert - /// \param[out] out conversion result - /// \return Status - /// - /// \note This function returns an error if the buffer isn't backed - /// by GPU memory - ARROW_DEPRECATED("Use Result-returning version") - static Status FromBuffer(std::shared_ptr buffer, - std::shared_ptr* out); - /// \brief Copy memory from GPU device to CPU host /// \param[in] position start position inside buffer to copy bytes from /// \param[in] nbytes number of bytes to copy @@ -107,15 +96,6 @@ class ARROW_EXPORT CudaBuffer : public Buffer { /// when the CudaBuffer is destructed virtual Result> ExportForIpc(); - /// \brief Expose this device buffer as IPC memory which can be used in other processes - /// \param[out] handle the exported IPC handle - /// \return Status - /// - /// \note After calling this function, this device memory will not be freed - /// when the CudaBuffer is destructed - ARROW_DEPRECATED("Use Result-returning version") - virtual Status ExportForIpc(std::shared_ptr* handle); - const std::shared_ptr& context() const { return context_; } protected: @@ -148,27 +128,12 @@ class ARROW_EXPORT CudaIpcMemHandle { /// \return Handle or Status static Result> FromBuffer(const void* opaque_handle); - /// \brief Create CudaIpcMemHandle from opaque buffer (e.g. from another process) - /// \param[in] opaque_handle a CUipcMemHandle as a const void* - /// \param[out] handle the CudaIpcMemHandle instance - /// \return Status - ARROW_DEPRECATED("Use Result-returning version") - static Status FromBuffer(const void* opaque_handle, - std::shared_ptr* handle); - /// \brief Write CudaIpcMemHandle to a Buffer /// \param[in] pool a MemoryPool to allocate memory from /// \return Buffer or Status Result> Serialize( MemoryPool* pool = default_memory_pool()) const; - /// \brief Write CudaIpcMemHandle to a Buffer - /// \param[in] pool a MemoryPool to allocate memory from - /// \param[out] out the serialized buffer - /// \return Status - ARROW_DEPRECATED("Use Result-returning version") - Status Serialize(MemoryPool* pool, std::shared_ptr* out) const; - private: explicit CudaIpcMemHandle(const void* handle); CudaIpcMemHandle(int64_t memory_size, const void* cu_handle); @@ -284,20 +249,6 @@ ARROW_EXPORT Result> AllocateCudaHostBuffer(int device_number, const int64_t size); -/// \brief Allocate CUDA-accessible memory on CPU host -/// -/// The GPU will benefit from fast access to this CPU-located buffer, -/// including fast memory copy. -/// -/// \param[in] device_number device to expose host memory -/// \param[in] size number of bytes -/// \param[out] out the allocated buffer -/// \return Status -ARROW_DEPRECATED("Use Result-returning version") -ARROW_EXPORT -Status AllocateCudaHostBuffer(int device_number, const int64_t size, - std::shared_ptr* out); - /// Low-level: get a device address through which the CPU data be accessed. Result GetDeviceAddress(const uint8_t* cpu_data, const std::shared_ptr& ctx); diff --git a/cpp/src/arrow/ipc/message.cc b/cpp/src/arrow/ipc/message.cc index 52cb6283c62..a27598ddbcb 100644 --- a/cpp/src/arrow/ipc/message.cc +++ b/cpp/src/arrow/ipc/message.cc @@ -860,17 +860,5 @@ std::unique_ptr MessageReader::Open( return std::unique_ptr(new InputStreamMessageReader(owned_stream)); } -// ---------------------------------------------------------------------- -// Deprecated functions - -Status ReadMessage(int64_t offset, int32_t metadata_length, io::RandomAccessFile* file, - std::unique_ptr* message) { - return ReadMessage(offset, metadata_length, file).Value(message); -} - -Status ReadMessage(io::InputStream* file, std::unique_ptr* out) { - return ReadMessage(file, default_memory_pool()).Value(out); -} - } // namespace ipc } // namespace arrow diff --git a/cpp/src/arrow/ipc/message.h b/cpp/src/arrow/ipc/message.h index 1b3fa8f861a..f35adef7add 100644 --- a/cpp/src/arrow/ipc/message.h +++ b/cpp/src/arrow/ipc/message.h @@ -84,12 +84,6 @@ class ARROW_EXPORT Message { static Result> Open(std::shared_ptr metadata, std::shared_ptr body); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(const std::shared_ptr& metadata, - const std::shared_ptr& body, std::unique_ptr* out) { - return Open(metadata, body).Value(out); - } - /// \brief Read message body and create Message given Flatbuffer metadata /// \param[in] metadata containing a serialized Message flatbuffer /// \param[in] stream an InputStream @@ -99,12 +93,6 @@ class ARROW_EXPORT Message { static Result> ReadFrom(std::shared_ptr metadata, io::InputStream* stream); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status ReadFrom(std::shared_ptr metadata, io::InputStream* stream, - std::unique_ptr* out) { - return ReadFrom(std::move(metadata), stream).Value(out); - } - /// \brief Read message body from position in file, and create Message given /// the Flatbuffer metadata /// \param[in] offset the position in the file where the message body starts. @@ -117,12 +105,6 @@ class ARROW_EXPORT Message { std::shared_ptr metadata, io::RandomAccessFile* file); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status ReadFrom(const int64_t offset, std::shared_ptr metadata, - io::RandomAccessFile* file, std::unique_ptr* out) { - return ReadFrom(offset, std::move(metadata), file).Value(out); - } - /// \brief Return true if message type and contents are equal /// /// \param other another message @@ -479,11 +461,6 @@ class ARROW_EXPORT MessageReader { /// /// \return an arrow::ipc::Message instance virtual Result> ReadNextMessage() = 0; - - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - Status ReadNextMessage(std::unique_ptr* message) { - return ReadNextMessage().Value(message); - } }; /// \brief Read encapsulated RPC message from position in file @@ -572,17 +549,5 @@ Status DecodeMessage(MessageDecoder* decoder, io::InputStream* stream); Status WriteMessage(const Buffer& message, const IpcWriteOptions& options, io::OutputStream* file, int32_t* message_length); -// ---------------------------------------------------------------------- -// Deprecated APIs - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") -ARROW_EXPORT -Status ReadMessage(const int64_t offset, const int32_t metadata_length, - io::RandomAccessFile* file, std::unique_ptr* message); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") -ARROW_EXPORT -Status ReadMessage(io::InputStream* stream, std::unique_ptr* message); - } // namespace ipc } // namespace arrow diff --git a/cpp/src/arrow/ipc/reader.cc b/cpp/src/arrow/ipc/reader.cc index 80f23661350..2e4e2b5a59c 100644 --- a/cpp/src/arrow/ipc/reader.cc +++ b/cpp/src/arrow/ipc/reader.cc @@ -1575,86 +1575,5 @@ Status FuzzIpcFile(const uint8_t* data, int64_t size) { } } // namespace internal - -// ---------------------------------------------------------------------- -// Deprecated functions - -Status RecordBatchStreamReader::Open(std::unique_ptr message_reader, - std::shared_ptr* out) { - return Open(std::move(message_reader), IpcReadOptions::Defaults()).Value(out); -} - -Status RecordBatchStreamReader::Open(std::unique_ptr message_reader, - std::unique_ptr* out) { - auto result = - std::unique_ptr(new RecordBatchStreamReaderImpl()); - RETURN_NOT_OK(result->Open(std::move(message_reader), IpcReadOptions::Defaults())); - *out = std::move(result); - return Status::OK(); -} - -Status RecordBatchStreamReader::Open(io::InputStream* stream, - std::shared_ptr* out) { - return Open(MessageReader::Open(stream)).Value(out); -} - -Status RecordBatchStreamReader::Open(const std::shared_ptr& stream, - std::shared_ptr* out) { - return Open(MessageReader::Open(stream)).Value(out); -} - -Status RecordBatchFileReader::Open(io::RandomAccessFile* file, - std::shared_ptr* out) { - return Open(file).Value(out); -} - -Status RecordBatchFileReader::Open(io::RandomAccessFile* file, int64_t footer_offset, - std::shared_ptr* out) { - return Open(file, footer_offset).Value(out); -} - -Status RecordBatchFileReader::Open(const std::shared_ptr& file, - std::shared_ptr* out) { - return Open(file).Value(out); -} - -Status RecordBatchFileReader::Open(const std::shared_ptr& file, - int64_t footer_offset, - std::shared_ptr* out) { - return Open(file, footer_offset).Value(out); -} - -Status ReadSchema(io::InputStream* stream, DictionaryMemo* dictionary_memo, - std::shared_ptr* out) { - return ReadSchema(stream, dictionary_memo).Value(out); -} - -Status ReadSchema(const Message& message, DictionaryMemo* dictionary_memo, - std::shared_ptr* out) { - return ReadSchema(message, dictionary_memo).Value(out); -} - -Status ReadRecordBatch(const std::shared_ptr& schema, - const DictionaryMemo* dictionary_memo, io::InputStream* stream, - std::shared_ptr* out) { - return ReadRecordBatch(schema, dictionary_memo, IpcReadOptions::Defaults(), stream) - .Value(out); -} - -Status ReadRecordBatch(const Message& message, const std::shared_ptr& schema, - const DictionaryMemo* dictionary_memo, - std::shared_ptr* out) { - return ReadRecordBatch(message, schema, dictionary_memo, IpcReadOptions::Defaults()) - .Value(out); -} - -Status ReadRecordBatch(const Buffer& metadata, const std::shared_ptr& schema, - const DictionaryMemo* dictionary_memo, io::RandomAccessFile* file, - std::shared_ptr* out) { - return ReadRecordBatch(metadata, schema, dictionary_memo, IpcReadOptions::Defaults(), - file) - .Value(out); -} - } // namespace ipc } // namespace arrow diff --git a/cpp/src/arrow/ipc/reader.h b/cpp/src/arrow/ipc/reader.h index 45d2ee32951..c606fd8a62b 100644 --- a/cpp/src/arrow/ipc/reader.h +++ b/cpp/src/arrow/ipc/reader.h @@ -94,18 +94,6 @@ class ARROW_EXPORT RecordBatchStreamReader : public RecordBatchReader { static Result> Open( const std::shared_ptr& stream, const IpcReadOptions& options = IpcReadOptions::Defaults()); - - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(std::unique_ptr message_reader, - std::shared_ptr* out); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(std::unique_ptr message_reader, - std::unique_ptr* out); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(io::InputStream* stream, std::shared_ptr* out); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(const std::shared_ptr& stream, - std::shared_ptr* out); }; /// \brief Reads the record batch file format @@ -157,19 +145,6 @@ class ARROW_EXPORT RecordBatchFileReader { const std::shared_ptr& file, int64_t footer_offset, const IpcReadOptions& options = IpcReadOptions::Defaults()); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(const std::shared_ptr& file, - int64_t footer_offset, std::shared_ptr* out); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(const std::shared_ptr& file, - std::shared_ptr* out); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(io::RandomAccessFile* file, int64_t footer_offset, - std::shared_ptr* out); - ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") - static Status Open(io::RandomAccessFile* file, - std::shared_ptr* out); - /// \brief The schema read from the file virtual std::shared_ptr schema() const = 0; @@ -189,11 +164,6 @@ class ARROW_EXPORT RecordBatchFileReader { /// \param[in] i the index of the record batch to return /// \return the read batch virtual Result> ReadRecordBatch(int i) = 0; - - ARROW_DEPRECATED("Use version with Result return value") - Status ReadRecordBatch(int i, std::shared_ptr* batch) { - return ReadRecordBatch(i).Value(batch); - } }; /// \class Listener @@ -514,33 +484,5 @@ Status FuzzIpcFile(const uint8_t* data, int64_t size); } // namespace internal -ARROW_DEPRECATED("Deprecated in 0.17.0. Use version with Result return value") -ARROW_EXPORT -Status ReadSchema(io::InputStream* stream, DictionaryMemo* dictionary_memo, - std::shared_ptr* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use version with Result return value") -ARROW_EXPORT -Status ReadSchema(const Message& message, DictionaryMemo* dictionary_memo, - std::shared_ptr* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use version with Result return value") -ARROW_EXPORT -Status ReadRecordBatch(const std::shared_ptr& schema, - const DictionaryMemo* dictionary_memo, io::InputStream* stream, - std::shared_ptr* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use version with Result return value") -ARROW_EXPORT -Status ReadRecordBatch(const Buffer& metadata, const std::shared_ptr& schema, - const DictionaryMemo* dictionary_memo, io::RandomAccessFile* file, - std::shared_ptr* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use version with Result return value") -ARROW_EXPORT -Status ReadRecordBatch(const Message& message, const std::shared_ptr& schema, - const DictionaryMemo* dictionary_memo, - std::shared_ptr* out); - } // namespace ipc } // namespace arrow diff --git a/cpp/src/arrow/ipc/writer.cc b/cpp/src/arrow/ipc/writer.cc index 568009bc886..c8bb9a336b4 100644 --- a/cpp/src/arrow/ipc/writer.cc +++ b/cpp/src/arrow/ipc/writer.cc @@ -1252,113 +1252,5 @@ Result> SerializeSchema(const Schema& schema, return stream->Finish(); } -// ---------------------------------------------------------------------- -// Deprecated functions - -Status RecordBatchStreamWriter::Open(io::OutputStream* sink, - const std::shared_ptr& schema, - std::shared_ptr* out) { - ASSIGN_OR_RAISE(*out, NewStreamWriter(sink, schema)); - return Status::OK(); -} - -Result> RecordBatchStreamWriter::Open( - io::OutputStream* sink, const std::shared_ptr& schema) { - return NewStreamWriter(sink, schema); -} - -Result> RecordBatchStreamWriter::Open( - io::OutputStream* sink, const std::shared_ptr& schema, - const IpcWriteOptions& options) { - return NewStreamWriter(sink, schema, options); -} - -Status RecordBatchFileWriter::Open(io::OutputStream* sink, - const std::shared_ptr& schema, - std::shared_ptr* out) { - ASSIGN_OR_RAISE(*out, NewFileWriter(sink, schema)); - return Status::OK(); -} - -Result> RecordBatchFileWriter::Open( - io::OutputStream* sink, const std::shared_ptr& schema) { - return NewFileWriter(sink, schema); -} - -Result> RecordBatchFileWriter::Open( - io::OutputStream* sink, const std::shared_ptr& schema, - const IpcWriteOptions& options) { - return NewFileWriter(sink, schema, options); -} - -Status SerializeRecordBatch(const RecordBatch& batch, const IpcWriteOptions& options, - std::shared_ptr* out) { - return SerializeRecordBatch(batch, options).Value(out); -} - -Status SerializeRecordBatch(const RecordBatch& batch, MemoryPool* pool, - std::shared_ptr* out) { - IpcWriteOptions options; - options.memory_pool = pool; - return SerializeRecordBatch(batch, options).Value(out); -} - -Status SerializeRecordBatch(const RecordBatch& batch, MemoryPool* pool, - io::OutputStream* out) { - IpcWriteOptions options; - options.memory_pool = pool; - return SerializeRecordBatch(batch, options, out); -} - -Status SerializeSchema(const Schema& schema, DictionaryMemo* dictionary_memo, - MemoryPool* pool, std::shared_ptr* out) { - return SerializeSchema(schema, dictionary_memo, pool).Value(out); -} - -Status WriteRecordBatch(const RecordBatch& batch, int64_t buffer_start_offset, - io::OutputStream* dst, int32_t* metadata_length, - int64_t* body_length, const IpcWriteOptions& options, - MemoryPool* pool) { - IpcWriteOptions modified_options = options; - modified_options.memory_pool = pool; - return WriteRecordBatch(batch, buffer_start_offset, dst, metadata_length, body_length, - modified_options); -} - -Status GetTensorMessage(const Tensor& tensor, MemoryPool* pool, - std::unique_ptr* out) { - return GetTensorMessage(tensor, pool).Value(out); -} - -Status GetSparseTensorMessage(const SparseTensor& sparse_tensor, MemoryPool* pool, - std::unique_ptr* out) { - return GetSparseTensorMessage(sparse_tensor, pool).Value(out); -} - -namespace internal { - -Status OpenRecordBatchWriter(std::unique_ptr sink, - const std::shared_ptr& schema, - std::unique_ptr* out) { - return OpenRecordBatchWriter(std::move(sink), schema).Value(out); -} - -Status GetRecordBatchPayload(const RecordBatch& batch, const IpcWriteOptions& options, - MemoryPool* pool, IpcPayload* out) { - IpcWriteOptions modified_options = options; - modified_options.memory_pool = pool; - return GetRecordBatchPayload(batch, modified_options, out); -} - -Status GetDictionaryPayload(int64_t id, const std::shared_ptr& dictionary, - const IpcWriteOptions& options, MemoryPool* pool, - IpcPayload* payload) { - IpcWriteOptions modified_options = options; - modified_options.memory_pool = pool; - return GetDictionaryPayload(id, dictionary, modified_options, payload); -} - -} // namespace internal - } // namespace ipc } // namespace arrow diff --git a/cpp/src/arrow/ipc/writer.h b/cpp/src/arrow/ipc/writer.h index 37c4997dcc9..1d46aa3ff10 100644 --- a/cpp/src/arrow/ipc/writer.h +++ b/cpp/src/arrow/ipc/writer.h @@ -78,9 +78,6 @@ class ARROW_EXPORT RecordBatchWriter { /// /// \return Status virtual Status Close() = 0; - - ARROW_DEPRECATED("Deprecated in 0.17.0. No-op. Pass MemoryPool using IpcWriteOptions") - void set_memory_pool(MemoryPool* pool) {} }; /// Create a new IPC stream writer from stream sink and schema. User is @@ -347,136 +344,5 @@ Status GetSparseTensorPayload(const SparseTensor& sparse_tensor, MemoryPool* poo IpcPayload* out); } // namespace internal - -// Deprecated functions - -/// \class RecordBatchStreamWriter -/// \brief Synchronous batch stream writer that writes the Arrow streaming -/// format -class ARROW_EXPORT RecordBatchStreamWriter : public RecordBatchWriter { - public: - /// Create a new writer from stream sink and schema. User is responsible for - /// closing the actual OutputStream. - /// - /// \param[in] sink output stream to write to - /// \param[in] schema the schema of the record batches to be written - /// \param[out] out the created stream writer - /// \return Status - ARROW_DEPRECATED("Deprecated in 0.17.0. Use arrow::ipc::NewStreamWriter()") - static Status Open(io::OutputStream* sink, const std::shared_ptr& schema, - std::shared_ptr* out); - - /// Create a new writer from stream sink and schema. User is responsible for - /// closing the actual OutputStream. - /// - /// \param[in] sink output stream to write to - /// \param[in] schema the schema of the record batches to be written - /// \return Result> - ARROW_DEPRECATED("Deprecated in 0.17.0. Use arrow::ipc::NewStreamWriter()") - static Result> Open( - io::OutputStream* sink, const std::shared_ptr& schema); - - ARROW_DEPRECATED("Deprecated in 0.17.0. Use arrow::ipc::NewStreamWriter()") - static Result> Open( - io::OutputStream* sink, const std::shared_ptr& schema, - const IpcWriteOptions& options); -}; - -/// \brief Creates the Arrow record batch file format -/// -/// Implements the random access file format, which structurally is a record -/// batch stream followed by a metadata footer at the end of the file. Magic -/// numbers are written at the start and end of the file -class ARROW_EXPORT RecordBatchFileWriter : public RecordBatchStreamWriter { - public: - /// Create a new writer from stream sink and schema - /// - /// \param[in] sink output stream to write to - /// \param[in] schema the schema of the record batches to be written - /// \param[out] out the created stream writer - /// \return Status - ARROW_DEPRECATED("Deprecated in 0.17.0. Use arrow::ipc::NewFileWriter") - static Status Open(io::OutputStream* sink, const std::shared_ptr& schema, - std::shared_ptr* out); - - /// Create a new writer from stream sink and schema - /// - /// \param[in] sink output stream to write to - /// \param[in] schema the schema of the record batches to be written - /// \return Result> - ARROW_DEPRECATED("Deprecated in 0.17.0. Use arrow::ipc::NewFileWriter") - static Result> Open( - io::OutputStream* sink, const std::shared_ptr& schema); - - ARROW_DEPRECATED("Deprecated in 0.17.0. Use arrow::ipc::NewFileWriter") - static Result> Open( - io::OutputStream* sink, const std::shared_ptr& schema, - const IpcWriteOptions& options); -}; - -ARROW_DEPRECATED( - "Deprecated in 0.17.0. Use version without MemoryPool argument " - "(use IpcWriteOptions to pass MemoryPool") -ARROW_EXPORT -Status WriteRecordBatch(const RecordBatch& batch, int64_t buffer_start_offset, - io::OutputStream* dst, int32_t* metadata_length, - int64_t* body_length, const IpcWriteOptions& options, - MemoryPool* pool); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") -ARROW_EXPORT -Status SerializeRecordBatch(const RecordBatch& batch, const IpcWriteOptions& options, - std::shared_ptr* out); - -ARROW_DEPRECATED( - "Deprecated in 0.17.0. Use Result-returning version with " - "IpcWriteOptions") -ARROW_EXPORT -Status SerializeRecordBatch(const RecordBatch& batch, MemoryPool* pool, - std::shared_ptr* out); - -ARROW_DEPRECATED( - "Deprecated in 0.17.0. Use Result-returning version with " - "IpcWriteOptions") -ARROW_EXPORT -Status SerializeRecordBatch(const RecordBatch& batch, MemoryPool* pool, - io::OutputStream* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") -ARROW_EXPORT -Status SerializeSchema(const Schema& schema, DictionaryMemo* dictionary_memo, - MemoryPool* pool, std::shared_ptr* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") -ARROW_EXPORT -Status GetTensorMessage(const Tensor& tensor, MemoryPool* pool, - std::unique_ptr* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") -ARROW_EXPORT -Status GetSparseTensorMessage(const SparseTensor& sparse_tensor, MemoryPool* pool, - std::unique_ptr* out); - -namespace internal { - -ARROW_DEPRECATED("Deprecated in 0.17.0. Use Result-returning version") -ARROW_EXPORT -Status OpenRecordBatchWriter(std::unique_ptr sink, - const std::shared_ptr& schema, - std::unique_ptr* out); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Pass MemoryPool with IpcWriteOptions") -ARROW_EXPORT -Status GetDictionaryPayload(int64_t id, const std::shared_ptr& dictionary, - const IpcWriteOptions& options, MemoryPool* pool, - IpcPayload* payload); - -ARROW_DEPRECATED("Deprecated in 0.17.0. Pass MemoryPool with IpcWriteOptions") -ARROW_EXPORT -Status GetRecordBatchPayload(const RecordBatch& batch, const IpcWriteOptions& options, - MemoryPool* pool, IpcPayload* out); - -} // namespace internal - } // namespace ipc } // namespace arrow diff --git a/cpp/src/arrow/record_batch.cc b/cpp/src/arrow/record_batch.cc index 6efce5adcdc..344c6679080 100644 --- a/cpp/src/arrow/record_batch.cc +++ b/cpp/src/arrow/record_batch.cc @@ -43,22 +43,6 @@ Result> RecordBatch::AddColumn( return AddColumn(i, field, column); } -Status RecordBatch::AddColumn(int i, std::string field_name, - const std::shared_ptr& column, - std::shared_ptr* out) const { - return AddColumn(i, std::move(field_name), column).Value(out); -} - -Status RecordBatch::AddColumn(int i, const std::shared_ptr& field, - const std::shared_ptr& column, - std::shared_ptr* out) const { - return AddColumn(i, field, column).Value(out); -} - -Status RecordBatch::RemoveColumn(int i, std::shared_ptr* out) const { - return RemoveColumn(i).Value(out); -} - std::shared_ptr RecordBatch::GetColumnByName(const std::string& name) const { auto i = schema_->GetFieldIndex(name); return i == -1 ? NULLPTR : column(i); @@ -335,15 +319,4 @@ Result> RecordBatchReader::Make( return std::make_shared(std::move(batches), schema); } -Result> MakeRecordBatchReader( - std::vector> batches, std::shared_ptr schema) { - return RecordBatchReader::Make(std::move(batches), std::move(schema)); -} - -Status MakeRecordBatchReader(std::vector> batches, - std::shared_ptr schema, - std::shared_ptr* out) { - return RecordBatchReader::Make(std::move(batches), std::move(schema)).Value(out); -} - } // namespace arrow diff --git a/cpp/src/arrow/record_batch.h b/cpp/src/arrow/record_batch.h index 29979e9629d..0d1b1b1fe8b 100644 --- a/cpp/src/arrow/record_batch.h +++ b/cpp/src/arrow/record_batch.h @@ -67,9 +67,6 @@ class ARROW_EXPORT RecordBatch { /// in the resulting struct array. Result> ToStructArray() const; - ARROW_DEPRECATED("Use Result-returning version") - Status ToStructArray(std::shared_ptr* out) const; - /// \brief Construct record batch from struct array /// /// This constructs a record batch using the child arrays of the given @@ -78,10 +75,6 @@ class ARROW_EXPORT RecordBatch { static Result> FromStructArray( const std::shared_ptr& array); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromStructArray(const std::shared_ptr& array, - std::shared_ptr* out); - /// \brief Determine if two record batches are exactly equal /// /// \param[in] other the RecordBatch to compare with @@ -126,11 +119,6 @@ class ARROW_EXPORT RecordBatch { int i, const std::shared_ptr& field, const std::shared_ptr& column) const = 0; - ARROW_DEPRECATED("Use Result-returning version") - Status AddColumn(int i, const std::shared_ptr& field, - const std::shared_ptr& column, - std::shared_ptr* out) const; - /// \brief Add new nullable column to the record batch, producing a new /// RecordBatch. /// @@ -142,18 +130,11 @@ class ARROW_EXPORT RecordBatch { virtual Result> AddColumn( int i, std::string field_name, const std::shared_ptr& column) const; - ARROW_DEPRECATED("Use Result-returning version") - Status AddColumn(int i, std::string field_name, const std::shared_ptr& column, - std::shared_ptr* out) const; - /// \brief Remove column from the record batch, producing a new RecordBatch /// /// \param[in] i field index, does boundscheck virtual Result> RemoveColumn(int i) const = 0; - ARROW_DEPRECATED("Use Result-returning version") - Status RemoveColumn(int i, std::shared_ptr* out) const; - virtual std::shared_ptr ReplaceSchemaMetadata( const std::shared_ptr& metadata) const = 0; @@ -244,14 +225,4 @@ class ARROW_EXPORT RecordBatchReader { std::shared_ptr schema = NULLPTR); }; -ARROW_DEPRECATED("Use RecordBatchReader::Make") -ARROW_EXPORT Result> MakeRecordBatchReader( - std::vector> batches, - std::shared_ptr schema = NULLPTR); - -ARROW_DEPRECATED("Use RecordBatchReader::Make") -ARROW_EXPORT Status MakeRecordBatchReader( - std::vector> batches, std::shared_ptr schema, - std::shared_ptr* out); - } // namespace arrow diff --git a/cpp/src/arrow/table.cc b/cpp/src/arrow/table.cc index c71ff1ac1df..da482b727d6 100644 --- a/cpp/src/arrow/table.cc +++ b/cpp/src/arrow/table.cc @@ -135,11 +135,6 @@ std::shared_ptr ChunkedArray::Slice(int64_t offset) const { return Slice(offset, length_); } -Status ChunkedArray::Flatten(MemoryPool* pool, - std::vector>* out) const { - return Flatten(pool).Value(out); -} - Result>> ChunkedArray::Flatten( MemoryPool* pool) const { if (type()->id() != Type::STRUCT) { @@ -176,11 +171,6 @@ Result> ChunkedArray::View( return std::make_shared(out_chunks, type); } -Status ChunkedArray::View(const std::shared_ptr& type, - std::shared_ptr* out) const { - return View(type).Value(out); -} - std::string ChunkedArray::ToString() const { std::stringstream ss; ARROW_CHECK_OK(PrettyPrint(*this, 0, &ss)); @@ -519,12 +509,6 @@ Result> Table::FromRecordBatches( return Table::Make(std::move(schema), std::move(columns), num_rows); } -Status Table::FromRecordBatches(std::shared_ptr schema, - const std::vector>& batches, - std::shared_ptr* table) { - return FromRecordBatches(std::move(schema), batches).Value(table); -} - Result> Table::FromRecordBatches( const std::vector>& batches) { if (batches.size() == 0) { @@ -534,11 +518,6 @@ Result> Table::FromRecordBatches( return FromRecordBatches(batches[0]->schema(), batches); } -Status Table::FromRecordBatches(const std::vector>& batches, - std::shared_ptr
* table) { - return FromRecordBatches(batches).Value(table); -} - Result> Table::FromChunkedStructArray( const std::shared_ptr& array) { auto type = array->type(); @@ -563,27 +542,6 @@ Result> Table::FromChunkedStructArray( array->length()); } -Status Table::FromChunkedStructArray(const std::shared_ptr& array, - std::shared_ptr
* table) { - return FromChunkedStructArray(array).Value(table); -} - -Status Table::RemoveColumn(int i, std::shared_ptr
* out) const { - return RemoveColumn(i).Value(out); -} - -Status Table::AddColumn(int i, std::shared_ptr field_arg, - std::shared_ptr column, - std::shared_ptr
* out) const { - return AddColumn(i, std::move(field_arg), std::move(column)).Value(out); -} - -Status Table::SetColumn(int i, std::shared_ptr field_arg, - std::shared_ptr column, - std::shared_ptr
* out) const { - return SetColumn(i, std::move(field_arg), std::move(column)).Value(out); -} - std::vector Table::ColumnNames() const { std::vector names(num_columns()); for (int i = 0; i < num_columns(); ++i) { @@ -607,15 +565,6 @@ Result> Table::RenameColumns( return Table::Make(::arrow::schema(std::move(fields)), std::move(columns), num_rows()); } -Status Table::RenameColumns(const std::vector& names, - std::shared_ptr
* out) const { - return RenameColumns(names).Value(out); -} - -Status Table::Flatten(MemoryPool* pool, std::shared_ptr
* out) const { - return Flatten(pool).Value(out); -} - std::string Table::ToString() const { std::stringstream ss; ARROW_CHECK_OK(PrettyPrint(*this, 0, &ss)); @@ -784,10 +733,6 @@ Result> Table::CombineChunks(MemoryPool* pool) const { return Table::Make(schema(), std::move(compacted_columns)); } -Status Table::CombineChunks(MemoryPool* pool, std::shared_ptr
* out) const { - return CombineChunks(pool).Value(out); -} - // ---------------------------------------------------------------------- // Convert a table to a sequence of record batches diff --git a/cpp/src/arrow/table.h b/cpp/src/arrow/table.h index 219ad982159..b38e25cc7ac 100644 --- a/cpp/src/arrow/table.h +++ b/cpp/src/arrow/table.h @@ -88,18 +88,11 @@ class ARROW_EXPORT ChunkedArray { Result>> Flatten( MemoryPool* pool = default_memory_pool()) const; - ARROW_DEPRECATED("Use Result-returning version") - Status Flatten(MemoryPool* pool, std::vector>* out) const; - /// Construct a zero-copy view of this chunked array with the given /// type. Calls Array::View on each constituent chunk. Always succeeds if /// there are zero chunks Result> View(const std::shared_ptr& type) const; - ARROW_DEPRECATED("Use Result-returning version") - Status View(const std::shared_ptr& type, - std::shared_ptr* out) const; - std::shared_ptr type() const { return type_; } /// \brief Determine if two chunked arrays are equal. @@ -257,11 +250,6 @@ class ARROW_EXPORT Table { static Result> FromRecordBatches( const std::vector>& batches); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromRecordBatches( - const std::vector>& batches, - std::shared_ptr
* table); - /// \brief Construct a Table from RecordBatches, using supplied schema. There may be /// zero record batches /// @@ -271,12 +259,6 @@ class ARROW_EXPORT Table { std::shared_ptr schema, const std::vector>& batches); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromRecordBatches( - std::shared_ptr schema, - const std::vector>& batches, - std::shared_ptr
* table); - /// \brief Construct a Table from a chunked StructArray. One column will be produced /// for each field of the StructArray. /// @@ -284,10 +266,6 @@ class ARROW_EXPORT Table { static Result> FromChunkedStructArray( const std::shared_ptr& array); - ARROW_DEPRECATED("Use Result-returning version") - static Status FromChunkedStructArray(const std::shared_ptr& array, - std::shared_ptr
* table); - /// \brief Return the table schema std::shared_ptr schema() const { return schema_; } @@ -328,29 +306,16 @@ class ARROW_EXPORT Table { /// \brief Remove column from the table, producing a new Table virtual Result> RemoveColumn(int i) const = 0; - ARROW_DEPRECATED("Use Result-returning version") - Status RemoveColumn(int i, std::shared_ptr
* out) const; - /// \brief Add column to the table, producing a new Table virtual Result> AddColumn( int i, std::shared_ptr field_arg, std::shared_ptr column) const = 0; - ARROW_DEPRECATED("Use Result-returning version") - Status AddColumn(int i, std::shared_ptr field_arg, - std::shared_ptr column, - std::shared_ptr
* out) const; - /// \brief Replace a column in the table, producing a new Table virtual Result> SetColumn( int i, std::shared_ptr field_arg, std::shared_ptr column) const = 0; - ARROW_DEPRECATED("Use Result-returning version") - Status SetColumn(int i, std::shared_ptr field_arg, - std::shared_ptr column, - std::shared_ptr
* out) const; - /// \brief Return names of all columns std::vector ColumnNames() const; @@ -358,10 +323,6 @@ class ARROW_EXPORT Table { Result> RenameColumns( const std::vector& names) const; - ARROW_DEPRECATED("Use Result-returning version") - Status RenameColumns(const std::vector& names, - std::shared_ptr
* out) const; - /// \brief Replace schema key-value metadata with new metadata (EXPERIMENTAL) /// \since 0.5.0 /// @@ -377,9 +338,6 @@ class ARROW_EXPORT Table { virtual Result> Flatten( MemoryPool* pool = default_memory_pool()) const = 0; - ARROW_DEPRECATED("Use Result-returning version") - Status Flatten(MemoryPool* pool, std::shared_ptr
* out) const; - /// \return PrettyPrint representation suitable for debugging std::string ToString() const; @@ -422,9 +380,6 @@ class ARROW_EXPORT Table { Result> CombineChunks( MemoryPool* pool = default_memory_pool()) const; - ARROW_DEPRECATED("Use Result-returning version") - Status CombineChunks(MemoryPool* pool, std::shared_ptr
* out) const; - protected: Table(); diff --git a/cpp/src/arrow/type.cc b/cpp/src/arrow/type.cc index ece671f34ad..4fe07f312fe 100644 --- a/cpp/src/arrow/type.cc +++ b/cpp/src/arrow/type.cc @@ -691,11 +691,6 @@ Result> Decimal128Type::Make(int32_t precision, int32_ return std::make_shared(precision, scale); } -Status Decimal128Type::Make(int32_t precision, int32_t scale, - std::shared_ptr* out) { - return Make(precision, scale).Value(out); -} - // ---------------------------------------------------------------------- // Dictionary-encoded type @@ -1312,20 +1307,6 @@ Result> Schema::RemoveField(int i) const { impl_->metadata_); } -Status Schema::AddField(int i, const std::shared_ptr& field, - std::shared_ptr* out) const { - return AddField(i, field).Value(out); -} - -Status Schema::SetField(int i, const std::shared_ptr& field, - std::shared_ptr* out) const { - return SetField(i, field).Value(out); -} - -Status Schema::RemoveField(int i, std::shared_ptr* out) const { - return RemoveField(i).Value(out); -} - bool Schema::HasMetadata() const { return (impl_->metadata_ != nullptr) && (impl_->metadata_->size() > 0); } diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h index 987e8aca300..b9daf2b7ec9 100644 --- a/cpp/src/arrow/type.h +++ b/cpp/src/arrow/type.h @@ -996,9 +996,6 @@ class ARROW_EXPORT Decimal128Type : public DecimalType { /// Decimal128Type constructor that returns an error on invalid input. static Result> Make(int32_t precision, int32_t scale); - ARROW_DEPRECATED("Use Result-returning version") - static Status Make(int32_t precision, int32_t scale, std::shared_ptr* out); - std::string ToString() const override; std::string name() const override { return "decimal"; } @@ -1384,10 +1381,6 @@ class ARROW_EXPORT DictionaryUnifier { static Result> Make( std::shared_ptr value_type, MemoryPool* pool = default_memory_pool()); - ARROW_DEPRECATED("Use Result-returning version") - static Status Make(MemoryPool* pool, std::shared_ptr value_type, - std::unique_ptr* out); - /// \brief Append dictionary to the internal memo virtual Status Unify(const Array& dictionary) = 0; @@ -1710,15 +1703,6 @@ class ARROW_EXPORT Schema : public detail::Fingerprintable, Result> SetField(int i, const std::shared_ptr& field) const; - ARROW_DEPRECATED("Use Result-returning version") - Status AddField(int i, const std::shared_ptr& field, - std::shared_ptr* out) const; - ARROW_DEPRECATED("Use Result-returning version") - Status RemoveField(int i, std::shared_ptr* out) const; - ARROW_DEPRECATED("Use Result-returning version") - Status SetField(int i, const std::shared_ptr& field, - std::shared_ptr* out) const; - /// \brief Replace key-value metadata with new metadata /// /// \param[in] metadata new KeyValueMetadata From 97628bbb8444b0bfc10e7e248284717a7117f21c Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Tue, 2 Jun 2020 20:18:37 -0500 Subject: [PATCH 2/2] Remove some deprecated CUDA implementation --- cpp/src/arrow/gpu/cuda_context.cc | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/cpp/src/arrow/gpu/cuda_context.cc b/cpp/src/arrow/gpu/cuda_context.cc index 456d3344323..bb0b055e5d2 100644 --- a/cpp/src/arrow/gpu/cuda_context.cc +++ b/cpp/src/arrow/gpu/cuda_context.cc @@ -610,28 +610,6 @@ Result> CudaContext::OpenIpcBuffer( } } -Status CudaContext::OpenIpcBuffer(const CudaIpcMemHandle& ipc_handle, - std::shared_ptr* out) { - if (ipc_handle.memory_size() > 0) { - ContextSaver set_temporary(*this); - uint8_t* data = nullptr; - RETURN_NOT_OK(impl_->OpenIpcBuffer(ipc_handle, &data)); - // Need to ask the device how big the buffer is - size_t allocation_size = 0; - CU_RETURN_NOT_OK("cuMemGetAddressRange", - cuMemGetAddressRange(nullptr, &allocation_size, - reinterpret_cast(data))); - *out = std::make_shared(data, allocation_size, this->shared_from_this(), - true, true); - } else { - // zero-sized buffer does not own data (which is nullptr), hence - // CloseIpcBuffer will not be called (see CudaBuffer::Close). - *out = - std::make_shared(nullptr, 0, this->shared_from_this(), false, true); - } - return Status::OK(); -} - Status CudaContext::CloseIpcBuffer(CudaBuffer* buf) { ContextSaver set_temporary(*this); CU_RETURN_NOT_OK("cuIpcCloseMemHandle", cuIpcCloseMemHandle(buf->address())); @@ -663,11 +641,5 @@ Result CudaContext::GetDeviceAddress(uint8_t* addr) { return GetDeviceAddress(reinterpret_cast(addr)); } -Status CudaContext::GetDeviceAddress(uint8_t* addr, uint8_t** devaddr) { - ARROW_ASSIGN_OR_RAISE(auto ptr, GetDeviceAddress(addr)); - *devaddr = reinterpret_cast(ptr); - return Status::OK(); -} - } // namespace cuda } // namespace arrow