wgtmac commented on code in PR #47190: URL: https://github.com/apache/arrow/pull/47190#discussion_r2241509481
########## cpp/src/parquet/types.cc: ########## @@ -96,40 +98,107 @@ bool PageCanUseChecksum(PageType::type pageType) { } } -std::string FormatStatValue(Type::type parquet_type, ::std::string_view val) { +namespace { + +template <typename T> +std::enable_if_t<std::is_arithmetic_v<T>, std::string> FormatNumericValue( + ::std::string_view val) { + std::stringstream result; + T value{}; + std::memcpy(&value, val.data(), sizeof(T)); + result << value; + return result.str(); +} + +std::string FormatDecimalValue(Type::type parquet_type, ::std::string_view val, + const std::shared_ptr<const LogicalType>& logical_type) { + ARROW_DCHECK(logical_type != nullptr && logical_type->is_decimal()); Review Comment: Then the caller needs to check nullability. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org