mapleFU commented on code in PR #35989:
URL: https://github.com/apache/arrow/pull/35989#discussion_r1238765709


##########
cpp/src/parquet/metadata.cc:
##########
@@ -87,20 +87,29 @@ std::string ParquetVersionToString(ParquetVersion::type 
ver) {
 template <typename DType>
 static std::shared_ptr<Statistics> MakeTypedColumnStats(
     const format::ColumnMetaData& metadata, const ColumnDescriptor* descr) {
+  DCHECK(metadata.__isset.statistics);
+  int64_t num_non_null_values = 0;
+  if (metadata.statistics.__isset.null_count) {
+    num_non_null_values = metadata.num_values - metadata.statistics.null_count;
+  } else {
+    // NOTE: statistics should `metadata.statistics.__isset.null_count`
+    // has a invalid non-null value number.

Review Comment:
   Can a `!metadata.statistics.__isset.null_count` might means:
   1. The underlying data has null
   2. But it doesn't write it into `statistics`
   
   If it can, when `!metadata.statistics.__isset.null_count`, 
`metadata.num_values - metadata.statistics.null_count` cannot represent the 
non-null count



-- 
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]

Reply via email to