Repository navigation
Conversation
|
|
|
|
| // If ColumnOrder is defined, return max_value and min_value | ||
| if (descr->column_order().get_order() == ColumnOrder::TYPE_DEFINED_ORDER) { | ||
| // Return max_value and min_value if defined | ||
| if (metadata.statistics.__isset.max_value || metadata.statistics.__isset.min_value) { |
There was a problem hiding this comment.
I don't think ColumnOrder checking can be removed here. If a writer does not set ColumnOrder but writes both min/max and min_value/max_value, we should still get stats from min/max as per the specs.
There was a problem hiding this comment.
According to the standard [1]. If we don't know the column-order, the max-value and min-value cannot be used. So the origin code here is ok.
However, I guess current impl is a bit weired, if it's column-order is unknown, it seek from min and max. Should we just return min-max not set. I guess the origin code is for compatible with legacy min and max. Can @pitrou confirm that?
In Java Parquet-mr and arrow-rs, if column-order is undefined, the behavior seems similiar. Rust think that it would be a SIGNED order[2], and parquet-mr[3] thinks it would be better to discard the min_value and max_value statistics
[1] https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L219
[2] https://github.com/apache/arrow-rs/blob/master/parquet/src/basic.rs#L450
[3] apache/parquet-java@c6764c4#diff-1afc9f89a782ddd4e7cd17546ca048954091627d7a31597ab88892eb2a7a76ab
|
By the way, do we discard the min-max when order is not |
|
I have customers file set (table, writer id - "parquet-mr compatible Photon version 0.2") |
Hmmm, for example, if you're using int32 and uint32, the encoded bytes might be the same, but the handling method would be different. As for string, it might has different collations. So just compare the binary usally doesn't get the right result. As the spec saying [1] "without column_orders, the meaning of the min_value and max_value fields in the Statistics object and the ColumnIndex object is undefined". So I guess this code can not checking. I think you can confirm with Photon contributor, and as for solving it, you can prune using thrift Statistics. [1] https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1049 |
just to confirm, let's we have column chunk with values V1..Vn, |
|
Yes, you're right. Here maybe it's better to check:
Current implemention may regard hasing |
|
As #34139 mentioned, I'll try to fix it this week. |
|
@rip-nsk Can we close this pr? Since the statistic is already disabled. |
|
Close this first. Feel free to reopen it |
Rationale for this change
min/max statistics can be stored in column chunk metadata in min/max or min_value/max_value fields.
current behavior for selecting a specific pair depends on the sort order, which may contradict to isset flag.
What changes are included in this PR?
Trivial change to get min/max column statistics by isset flag
Are these changes tested?
tested on customers data.
Are there any user-facing changes?
no