JFinis commented on code in PR #196:
URL: https://github.com/apache/parquet-format/pull/196#discussion_r1146076533
##########
README.md:
##########
@@ -163,18 +163,25 @@ following rules:
[Thrift definition](src/main/thrift/parquet.thrift) in the
`ColumnOrder` union. They are summarized here but the Thrift definition
is considered authoritative:
- * NaNs should not be written to min or max statistics fields.
- * If the computed max value is zero (whether negative or positive),
- `+0.0` should be written into the max statistics field.
- * If the computed min value is zero (whether negative or positive),
- `-0.0` should be written into the min statistics field.
-
- For backwards compatibility when reading files:
- * If the min is a NaN, it should be ignored.
- * If the max is a NaN, it should be ignored.
- * If the min is +0, the row group may contain -0 values as well.
- * If the max is -0, the row group may contain +0 values as well.
- * When looking for NaN values, min and max should be ignored.
+ * The following compatibility rules should be applied when reading
statistics:
+ * If the nan_count field is set to > 0 and both min and max are
Review Comment:
@mapleFU To your general comment (I can't answer there)
> The skeleton LGTM. But I wonder why if it has min/max/nan_count, it can
decide nan by min-max. Can we just decide it by `null_count + nan_count ==
num_values`?
The problem is that the ColumnIndex does not have the `num_values` field,
so using this computation to derive whether there are only NaNs would only be
applicable to Statistics, not to the column index. Of course, we could do what
I suggested in alternatives and give the column index a `num_values` list. Then
this would indeed work everywhere but at the cost of an additional list.
So I see we have the following options:
* Do what I did here, i.e., use min/max to determine whether there are only
NaNs
* Add a `num_values` list to the ColumnIndex
* Accept the fact that the column index cannot detect only-NaN pages (might
lead to fishy semantics)
* Tell readers to use the `min==max==NaN` reasoning only in the column
index, and use the `null_count + nan_count == num_values` for the statistics.
Which one would you suggest here?
--
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]