From 6b13479ae564c555cc12666bf09b23c7afe0ba39 Mon Sep 17 00:00:00 2001 From: mwish Date: Tue, 4 Jun 2024 21:43:58 +0800 Subject: [PATCH] minor fix --- cpp/src/arrow/extension/fixed_shape_tensor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/extension/fixed_shape_tensor.cc b/cpp/src/arrow/extension/fixed_shape_tensor.cc index 1d61e929073cd..12cdc08a27092 100644 --- a/cpp/src/arrow/extension/fixed_shape_tensor.cc +++ b/cpp/src/arrow/extension/fixed_shape_tensor.cc @@ -214,7 +214,7 @@ Result> FixedShapeTensorType::MakeTensor( return Status::TypeError("Cannot convert non-fixed-width values to Tensor."); } const auto& array = - internal::checked_pointer_cast(ext_scalar->value)->value; + internal::checked_cast(ext_scalar->value.get())->value; if (array->null_count() > 0) { return Status::Invalid("Cannot convert data with nulls to Tensor."); } @@ -264,6 +264,7 @@ Result> FixedShapeTensorArray::FromTensor std::vector dim_names; if (!tensor->dim_names().empty()) { + dim_names.reserve(permutation.size()); for (auto i : permutation) { dim_names.emplace_back(tensor->dim_names()[i]); }