@@ -34,8 +34,8 @@ template <int32_t PRECISION>
3434struct DecimalWithPrecisionAndScale {
3535 static_assert (PRECISION >= 1 && PRECISION <= 38 , " Invalid precision value" );
3636
37- using type = ::arrow::DecimalType ;
38- static constexpr ::arrow::Type::type type_id = ::arrow::DecimalType ::type_id;
37+ using type = ::arrow::Decimal128Type ;
38+ static constexpr ::arrow::Type::type type_id = ::arrow::Decimal128Type ::type_id;
3939 static constexpr int32_t precision = PRECISION ;
4040 static constexpr int32_t scale = PRECISION - 1 ;
4141};
@@ -156,8 +156,9 @@ NonNullArray(size_t size, std::shared_ptr<Array>* out) {
156156 constexpr int32_t kDecimalScale = DecimalWithPrecisionAndScale<precision>::scale;
157157
158158 const auto type = ::arrow::decimal (kDecimalPrecision , kDecimalScale );
159- ::arrow::DecimalBuilder builder (type);
160- const int32_t byte_width = static_cast <const ::arrow::DecimalType&>(*type).byte_width ();
159+ ::arrow::Decimal128Builder builder (type);
160+ const int32_t byte_width =
161+ static_cast <const ::arrow::Decimal128Type&>(*type).byte_width ();
161162
162163 constexpr int32_t seed = 0 ;
163164
@@ -317,15 +318,16 @@ NullableArray(size_t size, size_t num_nulls, uint32_t seed,
317318 constexpr int32_t kDecimalPrecision = precision;
318319 constexpr int32_t kDecimalScale = DecimalWithPrecisionAndScale<precision>::scale;
319320 const auto type = ::arrow::decimal (kDecimalPrecision , kDecimalScale );
320- const int32_t byte_width = static_cast <const ::arrow::DecimalType&>(*type).byte_width ();
321+ const int32_t byte_width =
322+ static_cast <const ::arrow::Decimal128Type&>(*type).byte_width ();
321323
322324 std::shared_ptr<::arrow::Buffer> out_buf;
323325 RETURN_NOT_OK (::arrow::AllocateBuffer (::arrow::default_memory_pool (), size * byte_width,
324326 &out_buf));
325327
326328 random_decimals (size, seed, precision, out_buf->mutable_data ());
327329
328- ::arrow::DecimalBuilder builder (type);
330+ ::arrow::Decimal128Builder builder (type);
329331 RETURN_NOT_OK (builder.Append (out_buf->data (), size, valid_bytes.data ()));
330332 return builder.Finish (out);
331333}
0 commit comments