You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@parquet.apache.org by "alkis (via GitHub)" <gi...@apache.org> on 2024/05/29 19:36:50 UTC
[PR] [T1] Allow fixed length encoding for min/max [parquet-format]
alkis opened a new pull request, #252:
URL: https://github.com/apache/parquet-format/pull/252
Add `min8`/`max8` fields for encoding fixed length binary encoding for min/max for physical types less than or equal 8 bytes.
ref [Parquet Metadata evolution](https://docs.google.com/document/d/1PQpY418LkIDHMFYCY8ne_G-CFpThK15LLpzWYbc7rFU/edit)
### Jira
- [ ] My PR addresses the following [Parquet Jira](https://issues.apache.org/jira/browse/PARQUET/) issues and references them in the PR title. For example, "PARQUET-1234: My Parquet PR"
- https://issues.apache.org/jira/browse/PARQUET-XXX
- In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
### Commits
- [ ] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
### Documentation
- [ ] In case of new functionality, my PR adds documentation that describes how to use it.
- All the public functions and the classes in the PR contain Javadoc that explain what it does
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] [T1] Allow fixed length encoding for min/max [parquet-format]
Posted by "alkis (via GitHub)" <gi...@apache.org>.
alkis commented on code in PR #252:
URL: https://github.com/apache/parquet-format/pull/252#discussion_r1620328668
##########
src/main/thrift/parquet.thrift:
##########
@@ -242,43 +242,36 @@ struct SizeStatistics {
* All fields are optional.
*/
struct Statistics {
- /**
- * DEPRECATED: min and max value of the column. Use min_value and max_value.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
- *
- * These fields encode min and max values determined by signed comparison
- * only. New files should use the correct order for a column's logical type
- * and store the values in the min_value and max_value fields.
- *
- * To support older readers, these may be set when the column order is
- * signed.
- */
+ /* DEPRECATED: do not use */
1: optional binary max;
2: optional binary min;
/** count of null value in the column */
3: optional i64 null_count;
/** count of distinct values occurring */
4: optional i64 distinct_count;
/**
- * Lower and upper bound values for the column, determined by its ColumnOrder.
+ * Only one pair of max_value/min_value, max1/min1, max2/min2, max4/min4,
+ * max8/min8 can be set. The pair is determined by the physical type of the
+ * column. Floating point values are bitcasted to integers. Variable length
+ * values are set in min_value/max_value.
Review Comment:
Rewritten this to be clearer.
##########
src/main/thrift/parquet.thrift:
##########
@@ -810,9 +803,13 @@ struct ColumnMetaData {
/** optional statistics for this column chunk */
12: optional Statistics statistics;
- /** Set of all encodings used for pages in this column chunk.
+ /**
+ * DEPRECATED: use is_fully_dict_encoded instead
Review Comment:
Agreed. I will create another PR for the Statistics change alone if we are OK merging that now.
##########
src/main/thrift/parquet.thrift:
##########
@@ -242,43 +242,36 @@ struct SizeStatistics {
* All fields are optional.
*/
struct Statistics {
- /**
- * DEPRECATED: min and max value of the column. Use min_value and max_value.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
- *
- * These fields encode min and max values determined by signed comparison
- * only. New files should use the correct order for a column's logical type
- * and store the values in the min_value and max_value fields.
- *
- * To support older readers, these may be set when the column order is
- * signed.
- */
+ /* DEPRECATED: do not use */
1: optional binary max;
2: optional binary min;
/** count of null value in the column */
3: optional i64 null_count;
/** count of distinct values occurring */
4: optional i64 distinct_count;
/**
- * Lower and upper bound values for the column, determined by its ColumnOrder.
+ * Only one pair of max_value/min_value, max1/min1, max2/min2, max4/min4,
+ * max8/min8 can be set. The pair is determined by the physical type of the
+ * column. Floating point values are bitcasted to integers. Variable length
+ * values are set in min_value/max_value.
+ *
+ * Min and Max are the lower and upper bound values for the column,
+ * respectively, as determined by its ColumnOrder.
*
* These may be the actual minimum and maximum values found on a page or column
* chunk, but can also be (more compact) values that do not exist on a page or
* column chunk. For example, instead of storing "Blart Versenwald III", a writer
* may set min_value="B", max_value="C". Such more compact values must still be
* valid values within the column's logical type.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
*/
5: optional binary max_value;
6: optional binary min_value;
/** If true, max_value is the actual maximum value for a column */
7: optional bool is_max_value_exact;
/** If true, min_value is the actual minimum value for a column */
8: optional bool is_min_value_exact;
+ 9: optional i64 max8;
Review Comment:
Yes I removed them because they provide little benefit and do not justify the added complexity.
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] [T1] Allow fixed length encoding for min/max [parquet-format]
Posted by "emkornfield (via GitHub)" <gi...@apache.org>.
emkornfield commented on code in PR #252:
URL: https://github.com/apache/parquet-format/pull/252#discussion_r1619493190
##########
src/main/thrift/parquet.thrift:
##########
@@ -242,43 +242,36 @@ struct SizeStatistics {
* All fields are optional.
*/
struct Statistics {
- /**
- * DEPRECATED: min and max value of the column. Use min_value and max_value.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
- *
- * These fields encode min and max values determined by signed comparison
- * only. New files should use the correct order for a column's logical type
- * and store the values in the min_value and max_value fields.
- *
- * To support older readers, these may be set when the column order is
- * signed.
- */
+ /* DEPRECATED: do not use */
1: optional binary max;
2: optional binary min;
/** count of null value in the column */
3: optional i64 null_count;
/** count of distinct values occurring */
4: optional i64 distinct_count;
/**
- * Lower and upper bound values for the column, determined by its ColumnOrder.
+ * Only one pair of max_value/min_value, max1/min1, max2/min2, max4/min4,
+ * max8/min8 can be set. The pair is determined by the physical type of the
+ * column. Floating point values are bitcasted to integers. Variable length
+ * values are set in min_value/max_value.
Review Comment:
Could you please update the docs for readers for backwards compatibility should check min_value/max_value if the non-variable width field is not not set?
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] [T1] Allow fixed length encoding for min/max [parquet-format]
Posted by "emkornfield (via GitHub)" <gi...@apache.org>.
emkornfield commented on code in PR #252:
URL: https://github.com/apache/parquet-format/pull/252#discussion_r1619493190
##########
src/main/thrift/parquet.thrift:
##########
@@ -242,43 +242,36 @@ struct SizeStatistics {
* All fields are optional.
*/
struct Statistics {
- /**
- * DEPRECATED: min and max value of the column. Use min_value and max_value.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
- *
- * These fields encode min and max values determined by signed comparison
- * only. New files should use the correct order for a column's logical type
- * and store the values in the min_value and max_value fields.
- *
- * To support older readers, these may be set when the column order is
- * signed.
- */
+ /* DEPRECATED: do not use */
1: optional binary max;
2: optional binary min;
/** count of null value in the column */
3: optional i64 null_count;
/** count of distinct values occurring */
4: optional i64 distinct_count;
/**
- * Lower and upper bound values for the column, determined by its ColumnOrder.
+ * Only one pair of max_value/min_value, max1/min1, max2/min2, max4/min4,
+ * max8/min8 can be set. The pair is determined by the physical type of the
+ * column. Floating point values are bitcasted to integers. Variable length
+ * values are set in min_value/max_value.
Review Comment:
Could you please update the docs for readers for backwards compatibility should check min_value/max_value?
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] [T1] Allow fixed length encoding for min/max [parquet-format]
Posted by "emkornfield (via GitHub)" <gi...@apache.org>.
emkornfield commented on code in PR #252:
URL: https://github.com/apache/parquet-format/pull/252#discussion_r1619493684
##########
src/main/thrift/parquet.thrift:
##########
@@ -242,43 +242,36 @@ struct SizeStatistics {
* All fields are optional.
*/
struct Statistics {
- /**
- * DEPRECATED: min and max value of the column. Use min_value and max_value.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
- *
- * These fields encode min and max values determined by signed comparison
- * only. New files should use the correct order for a column's logical type
- * and store the values in the min_value and max_value fields.
- *
- * To support older readers, these may be set when the column order is
- * signed.
- */
+ /* DEPRECATED: do not use */
1: optional binary max;
2: optional binary min;
/** count of null value in the column */
3: optional i64 null_count;
/** count of distinct values occurring */
4: optional i64 distinct_count;
/**
- * Lower and upper bound values for the column, determined by its ColumnOrder.
+ * Only one pair of max_value/min_value, max1/min1, max2/min2, max4/min4,
+ * max8/min8 can be set. The pair is determined by the physical type of the
+ * column. Floating point values are bitcasted to integers. Variable length
+ * values are set in min_value/max_value.
+ *
+ * Min and Max are the lower and upper bound values for the column,
+ * respectively, as determined by its ColumnOrder.
*
* These may be the actual minimum and maximum values found on a page or column
* chunk, but can also be (more compact) values that do not exist on a page or
* column chunk. For example, instead of storing "Blart Versenwald III", a writer
* may set min_value="B", max_value="C". Such more compact values must still be
* valid values within the column's logical type.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
*/
5: optional binary max_value;
6: optional binary min_value;
/** If true, max_value is the actual maximum value for a column */
7: optional bool is_max_value_exact;
/** If true, min_value is the actual minimum value for a column */
8: optional bool is_min_value_exact;
+ 9: optional i64 max8;
Review Comment:
did you intentionally elide min1/max1? (they are still mentioned above).
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] [T1] Allow fixed length encoding for min/max and deprecate encoding_stats [parquet-format]
Posted by "emkornfield (via GitHub)" <gi...@apache.org>.
emkornfield commented on code in PR #252:
URL: https://github.com/apache/parquet-format/pull/252#discussion_r1622698456
##########
src/main/thrift/parquet.thrift:
##########
@@ -243,42 +243,39 @@ struct SizeStatistics {
*/
struct Statistics {
/**
- * DEPRECATED: min and max value of the column. Use min_value and max_value.
+ * max/min: deprecated, used to encoded signed orderable values, ignoring
+ * the columns ColumnOrder
+ * max_value/min_value: PLAIN encoded values, sans length prefix if varlen
+ * max8/min8: up to 8-bytes:
+ * FLOAT, DOUBLE: bitcasted to INT32 and INT64, respectively
Review Comment:
I think we might want to be more specific here about values less then 8 bytes are translated into 8 bytes. In practice it doesn't make a difference for readers but it would be good to limit ambiguity. I assume we do a normal cast from 1/4 integer byte values to 8 bytes values rather then just embedding them?
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] [T1] Allow fixed length encoding for min/max and deprecate encoding_stats [parquet-format]
Posted by "alkis (via GitHub)" <gi...@apache.org>.
alkis commented on code in PR #252:
URL: https://github.com/apache/parquet-format/pull/252#discussion_r1620333181
##########
src/main/thrift/parquet.thrift:
##########
@@ -242,43 +242,36 @@ struct SizeStatistics {
* All fields are optional.
*/
struct Statistics {
- /**
- * DEPRECATED: min and max value of the column. Use min_value and max_value.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
- *
- * These fields encode min and max values determined by signed comparison
- * only. New files should use the correct order for a column's logical type
- * and store the values in the min_value and max_value fields.
- *
- * To support older readers, these may be set when the column order is
- * signed.
- */
+ /* DEPRECATED: do not use */
1: optional binary max;
2: optional binary min;
/** count of null value in the column */
3: optional i64 null_count;
/** count of distinct values occurring */
4: optional i64 distinct_count;
/**
- * Lower and upper bound values for the column, determined by its ColumnOrder.
+ * Only one pair of max_value/min_value, max1/min1, max2/min2, max4/min4,
+ * max8/min8 can be set. The pair is determined by the physical type of the
+ * column. Floating point values are bitcasted to integers. Variable length
+ * values are set in min_value/max_value.
+ *
+ * Min and Max are the lower and upper bound values for the column,
+ * respectively, as determined by its ColumnOrder.
*
* These may be the actual minimum and maximum values found on a page or column
* chunk, but can also be (more compact) values that do not exist on a page or
* column chunk. For example, instead of storing "Blart Versenwald III", a writer
* may set min_value="B", max_value="C". Such more compact values must still be
* valid values within the column's logical type.
- *
- * Values are encoded using PLAIN encoding, except that variable-length byte
- * arrays do not include a length prefix.
*/
5: optional binary max_value;
6: optional binary min_value;
/** If true, max_value is the actual maximum value for a column */
7: optional bool is_max_value_exact;
/** If true, min_value is the actual minimum value for a column */
8: optional bool is_min_value_exact;
+ 9: optional i64 max8;
Review Comment:
Yes I removed them because they provide little benefit and do not justify the added complexity. This is because in thrift these are ulebs so it makes no difference in the wire. For flatbuffers this would make a difference though.
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org
Re: [PR] [T1] Allow fixed length encoding for min/max [parquet-format]
Posted by "emkornfield (via GitHub)" <gi...@apache.org>.
emkornfield commented on code in PR #252:
URL: https://github.com/apache/parquet-format/pull/252#discussion_r1619494407
##########
src/main/thrift/parquet.thrift:
##########
@@ -810,9 +803,13 @@ struct ColumnMetaData {
/** optional statistics for this column chunk */
12: optional Statistics statistics;
- /** Set of all encodings used for pages in this column chunk.
+ /**
+ * DEPRECATED: use is_fully_dict_encoded instead
Review Comment:
I would suggest making this a separate PR, I think we'd prefer to keep the changes as small and focused as possible?
--
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: issues-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@parquet.apache.org
For additional commands, e-mail: issues-help@parquet.apache.org