benibus commented on code in PR #46973:
URL: https://github.com/apache/arrow/pull/46973#discussion_r2320980286
##########
cpp/src/arrow/testing/random.cc:
##########
@@ -1089,10 +1144,25 @@ std::shared_ptr<Array>
RandomArrayGenerator::ArrayOf(const Field& field, int64_t
GENERATE_INTEGRAL_CASE(Int32Type);
GENERATE_INTEGRAL_CASE(UInt64Type);
GENERATE_INTEGRAL_CASE(Int64Type);
- GENERATE_INTEGRAL_CASE_VIEW(Int16Type, HalfFloatType);
GENERATE_FLOATING_CASE(FloatType, Float32);
GENERATE_FLOATING_CASE(DoubleType, Float64);
+ case Type::type::HALF_FLOAT: {
+ using ValueType = util::Float16;
+ const ValueType min_value = GetMetadata<ValueType>(
+ field.metadata().get(), "min",
std::numeric_limits<ValueType>::min());
+ const ValueType max_value = GetMetadata<ValueType>(
+ field.metadata().get(), "max",
std::numeric_limits<ValueType>::max());
+ const double nan_probability =
+ GetMetadata<double>(field.metadata().get(), "nan_probability", 0);
+ VALIDATE_MIN_MAX(min_value, max_value);
+ VALIDATE_RANGE(nan_probability, 0.0, 1.0);
+ ARROW_LOG(INFO) << "min = " << min_value.ToFloat();
+ ARROW_LOG(INFO) << "max = " << max_value.ToFloat();
Review Comment:
Ah, thanks! Just removed them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]