Skip to content

Commit 8c27898

Browse files
authored
GH-49356: [C++] Remove deprecated APIs from v13.0.0 and v18.0.0 (#49171)
### Rationale for This Change This PR removes C++ APIs that have been deprecated for more than one year, in line with Arrow's deprecation and cleanup policy. All removed APIs were deprecated before January 1, 2025. --- ### What Changes Are Included in This PR? This PR removes **3 deprecated C++ APIs**: **1. `decimal(precision, scale)` function** - Deprecated in v18.0.0 (September 30, 2024, PR #43957) - Replacement: `smallest_decimal(precision, scale)` - Removed from: `cpp/src/arrow/type_fwd.h`, `cpp/src/arrow/type.cc` **2. `cuda::DefaultMemoryMapper(device_type, device_id)` function** - Deprecated in v16.0.0 (April 16, 2024, PR #40699) - Replacement: `arrow::DefaultDeviceMapper` - Removed from: `cpp/src/arrow/gpu/cuda_memory.h`, `cpp/src/arrow/gpu/cuda_memory.cc` **3. `HasValidityBitmap(Type::type id)` global function** - Deprecated in v17.0.0 (July 11, 2024, PR #41115) - Replacement: `may_have_validity_bitmap(Type::type id)` - Removed from: `cpp/src/arrow/type.h` - Note: Member functions like `ArrayData::HasValidityBitmap()` remain unchanged --- ### Are These Changes Tested? Yes. Verified via full codebase search that all removed symbols have zero remaining usages in the C++ codebase. --- ### Are There Any User-Facing Changes? Yes. Downstream C++ consumers using these deprecated APIs will need to migrate to the replacement APIs listed above. --- * GitHub Issue: #49356 Authored-by: unknown <alimahmoodrana82@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 0cf32b2 commit 8c27898

File tree

5 files changed

+0
-41
lines changed

5 files changed

+0
-41
lines changed

cpp/src/arrow/gpu/cuda_memory.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -486,23 +486,6 @@ Result<uint8_t*> GetHostAddress(uintptr_t device_ptr) {
486486
return static_cast<uint8_t*>(ptr);
487487
}
488488

489-
Result<std::shared_ptr<MemoryManager>> DefaultMemoryMapper(ArrowDeviceType device_type,
490-
int64_t device_id) {
491-
switch (device_type) {
492-
case ARROW_DEVICE_CPU:
493-
return default_cpu_memory_manager();
494-
case ARROW_DEVICE_CUDA:
495-
case ARROW_DEVICE_CUDA_HOST:
496-
case ARROW_DEVICE_CUDA_MANAGED: {
497-
ARROW_ASSIGN_OR_RAISE(auto device,
498-
arrow::cuda::CudaDevice::Make(static_cast<int>(device_id)));
499-
return device->default_memory_manager();
500-
}
501-
default:
502-
return Status::NotImplemented("memory manager not implemented for device");
503-
}
504-
}
505-
506489
namespace {
507490

508491
Result<std::shared_ptr<MemoryManager>> DefaultCUDADeviceMapper(int64_t device_id) {

cpp/src/arrow/gpu/cuda_memory.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,5 @@ Result<uintptr_t> GetDeviceAddress(const uint8_t* cpu_data,
261261
ARROW_CUDA_EXPORT
262262
Result<uint8_t*> GetHostAddress(uintptr_t device_ptr);
263263

264-
ARROW_DEPRECATED(
265-
"Deprecated in 16.0.0. The CUDA device is registered by default, and you can use "
266-
"arrow::DefaultDeviceMapper instead.")
267-
Result<std::shared_ptr<MemoryManager>> DefaultMemoryMapper(ArrowDeviceType device_type,
268-
int64_t device_id);
269-
270264
} // namespace cuda
271265
} // namespace arrow

cpp/src/arrow/type.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,11 +3346,6 @@ std::shared_ptr<Field> field(std::string name, std::shared_ptr<DataType> type,
33463346
std::move(metadata));
33473347
}
33483348

3349-
std::shared_ptr<DataType> decimal(int32_t precision, int32_t scale) {
3350-
return precision <= Decimal128Type::kMaxPrecision ? decimal128(precision, scale)
3351-
: decimal256(precision, scale);
3352-
}
3353-
33543349
std::shared_ptr<DataType> smallest_decimal(int32_t precision, int32_t scale) {
33553350
return precision <= Decimal32Type::kMaxPrecision ? decimal32(precision, scale)
33563351
: precision <= Decimal64Type::kMaxPrecision ? decimal64(precision, scale)

cpp/src/arrow/type.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,9 +2585,6 @@ constexpr bool has_variadic_buffers(Type::type id) {
25852585
}
25862586
}
25872587

2588-
ARROW_DEPRECATED("Deprecated in 17.0.0. Use may_have_validity_bitmap() instead.")
2589-
constexpr bool HasValidityBitmap(Type::type id) { return may_have_validity_bitmap(id); }
2590-
25912588
ARROW_EXPORT
25922589
std::string ToString(Type::type id);
25932590

cpp/src/arrow/type_fwd.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -532,16 +532,6 @@ ARROW_EXPORT const std::shared_ptr<DataType>& date64();
532532
ARROW_EXPORT
533533
std::shared_ptr<DataType> fixed_size_binary(int32_t byte_width);
534534

535-
/// \brief Create a DecimalType instance depending on the precision
536-
///
537-
/// If the precision is greater than 38, a Decimal256Type is returned,
538-
/// otherwise a Decimal128Type.
539-
///
540-
/// Deprecated: prefer `smallest_decimal` instead.
541-
ARROW_DEPRECATED("Deprecated in 18.0. Use `smallest_decimal` instead")
542-
ARROW_EXPORT
543-
std::shared_ptr<DataType> decimal(int32_t precision, int32_t scale);
544-
545535
/// \brief Create a the smallest DecimalType instance depending on precision
546536
///
547537
/// Given the requested precision and scale, the smallest DecimalType which

0 commit comments

Comments
 (0)