kou commented on code in PR #43984:
URL: https://github.com/apache/arrow/pull/43984#discussion_r1749403797
##########
cpp/src/parquet/arrow/reader_internal.cc:
##########
@@ -352,31 +342,63 @@ Status TransferInt(RecordReader* reader,
static_cast<::parquet::TypedStatistics<ParquetType>*>(statistics);
const ArrowCType min = typed_statistics->min();
const ArrowCType max = typed_statistics->max();
- if (std::is_signed<ArrowCType>::value) {
+ if (std::is_floating_point<ArrowCType>::value) {
+ array_statistics->min = static_cast<double>(min);
+ array_statistics->max = static_cast<double>(max);
+ } else if (std::is_signed<ArrowCType>::value) {
array_statistics->min = static_cast<int64_t>(min);
array_statistics->max = static_cast<int64_t>(max);
} else {
array_statistics->min = static_cast<uint64_t>(min);
array_statistics->max = static_cast<uint64_t>(max);
}
- // We can assume that integer based min/max are always exact if
- // they exist. Apache Parquet's "Statistics" has
- // "is_min_value_exact" and "is_max_value_exact" but we can
- // ignore them for integer based min/max.
+ // We can assume that integer and floating point number based
+ // min/max are always exact if they exist. Apache Parquet's
+ // "Statistics" has "is_min_value_exact" and
+ // "is_max_value_exact" but we can ignore them for integer and
+ // floating point number based min/max.
Review Comment:
Sorry. I forgot to add a note about floating point number in the first
commit.
I've added it before I merge this.
--
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]