You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by GitBox <gi...@apache.org> on 2022/11/05 04:34:50 UTC

[GitHub] [parquet-format] emkornfield opened a new pull request, #185: PARQUET-1222: [Format] Add deails about sort order to README.md

emkornfield opened a new pull request, #185:
URL: https://github.com/apache/parquet-format/pull/185

   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x ] 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"
   
   
   


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] emkornfield commented on pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
emkornfield commented on PR #185:
URL: https://github.com/apache/parquet-format/pull/185#issuecomment-1340395605

   @gszadovszky @pitrou thanks for the review.  I believe I incorporated the remaining feedback.


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] pitrou merged pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
pitrou merged PR #185:
URL: https://github.com/apache/parquet-format/pull/185


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] pitrou commented on pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #185:
URL: https://github.com/apache/parquet-format/pull/185#issuecomment-1341327375

   > @pitrou thanks for merging, I'm not sure if we needed an official vote on this?
   
   Oops, that's a good question. I might have merged too quickly. @gszadovszky What is your take on 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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] emkornfield commented on pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
emkornfield commented on PR #185:
URL: https://github.com/apache/parquet-format/pull/185#issuecomment-1341349709

   > I don't feel it would require a formal vote. In my view it was more a missing part of the spec that is made clear.
   It might worth a heads up on the dev list, though.
   
   Replied to my original thread that this has been merged.


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] emkornfield commented on pull request #185: PARQUET-1222: [Format] Add deails about sort order to README.md

Posted by GitBox <gi...@apache.org>.
emkornfield commented on PR #185:
URL: https://github.com/apache/parquet-format/pull/185#issuecomment-1307760898

   @pitrou @gszadovszky 


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] emkornfield commented on a diff in pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
emkornfield commented on code in PR #185:
URL: https://github.com/apache/parquet-format/pull/185#discussion_r1041775669


##########
README.md:
##########
@@ -144,6 +144,38 @@ documented in [LogicalTypes.md][logical-types].
 
 [logical-types]: LogicalTypes.md
 
+### Sort Order
+
+Parquet stores min/max statistics at several levels (e.g. RowGroup, Page Index,
+etc). Comparison for values of a type follow the following logic:
+
+1.  Each logical type has a specified comparison order. If a column is
+    annotated with an unknown logical type, statistics may not be used
+    for pruning data. The sort order for logical types is documented in
+    the [LogicalTypes.md][logical-types] page.
+2.  For primitives the following sort orders apply:
+
+    * BOOLEAN - false, true
+    * INT32, INT64, FLOAT, DOUBLE - Signed comparison. Floating point values are
+      not totally ordered due to special case like NaN. They require special
+      handling when reading statistics. The details are documented in parquet.thrift in the
+      `ColumnOrder` union. They are summarized 

Review Comment:
   done.



-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] pitrou commented on a diff in pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
pitrou commented on code in PR #185:
URL: https://github.com/apache/parquet-format/pull/185#discussion_r1041067303


##########
README.md:
##########
@@ -144,6 +144,38 @@ documented in [LogicalTypes.md][logical-types].
 
 [logical-types]: LogicalTypes.md
 
+### Sort Order
+
+Parquet stores min/max statistics at several levels (e.g. RowGroup, Page Index,
+etc). Comparison for values of a type follow the following logic:

Review Comment:
   ```suggestion
   Parquet stores min/max statistics at several levels (such as Column Chunk,
   Column Index and Data Page). Comparison for values of a type obey the
   following rules:
   ```



##########
README.md:
##########
@@ -144,6 +144,38 @@ documented in [LogicalTypes.md][logical-types].
 
 [logical-types]: LogicalTypes.md
 
+### Sort Order
+
+Parquet stores min/max statistics at several levels (e.g. RowGroup, Page Index,
+etc). Comparison for values of a type follow the following logic:
+
+1.  Each logical type has a specified comparison order. If a column is
+    annotated with an unknown logical type, statistics may not be used
+    for pruning data. The sort order for logical types is documented in
+    the [LogicalTypes.md][logical-types] page.
+2.  For primitives the following sort orders apply:
+
+    * BOOLEAN - false, true
+    * INT32, INT64, FLOAT, DOUBLE - Signed comparison. Floating point values are
+      not totally ordered due to special case like NaN. They require special
+      handling when reading statistics. The details are documented in parquet.thrift in the
+      `ColumnOrder` union. They are summarized 

Review Comment:
   Need to synchronize this with the final wording from `parquet.thrift`.



##########
README.md:
##########
@@ -144,6 +144,38 @@ documented in [LogicalTypes.md][logical-types].
 
 [logical-types]: LogicalTypes.md
 
+### Sort Order
+
+Parquet stores min/max statistics at several levels (e.g. RowGroup, Page Index,
+etc). Comparison for values of a type follow the following logic:
+
+1.  Each logical type has a specified comparison order. If a column is
+    annotated with an unknown logical type, statistics may not be used
+    for pruning data. The sort order for logical types is documented in
+    the [LogicalTypes.md][logical-types] page.
+2.  For primitives the following sort orders apply:

Review Comment:
   ```suggestion
   2.  For primitive types, the following rules apply:
   ```



##########
src/main/thrift/parquet.thrift:
##########
@@ -902,6 +902,13 @@ union ColumnOrder {
    *     - 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.
+   * 
+   *     When writing statistics the following rules should be followed:
+   *     - NaNs should not be written to min or max statistics fields.
+   *     - Only -0 should be written into min statistics fields (if only 
+   *       +0 is present in the column it should be converted to -0.0).
+   *     - Only +0 should be written into a max statistics fields (if 
+   *       only -0 is present it must be convereted to +0).

Review Comment:
   Suggestion to make wording clearer.
   ```suggestion
      *     - 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.
   ```



##########
README.md:
##########
@@ -144,6 +144,38 @@ documented in [LogicalTypes.md][logical-types].
 
 [logical-types]: LogicalTypes.md
 
+### Sort Order
+
+Parquet stores min/max statistics at several levels (e.g. RowGroup, Page Index,
+etc). Comparison for values of a type follow the following logic:
+
+1.  Each logical type has a specified comparison order. If a column is
+    annotated with an unknown logical type, statistics may not be used
+    for pruning data. The sort order for logical types is documented in
+    the [LogicalTypes.md][logical-types] page.
+2.  For primitives the following sort orders apply:
+
+    * BOOLEAN - false, true
+    * INT32, INT64, FLOAT, DOUBLE - Signed comparison. Floating point values are

Review Comment:
   I would suggest making a separate list item for floating-point:
   ```suggestion
       * INT32, INT64 - Signed comparison.
       * FLOAT, DOUBLE - Signed comparison with special handling of NaNs
         and signed zeros. The details are documented in...
   ```



-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] emkornfield commented on pull request #185: PARQUET-1222: [Format] Add deails about sort order to README.md

Posted by GitBox <gi...@apache.org>.
emkornfield commented on PR #185:
URL: https://github.com/apache/parquet-format/pull/185#issuecomment-1338880938

   @gszadovszky thanks for the feedback I tried to address it in the latest commit.


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] pitrou commented on pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
pitrou commented on PR #185:
URL: https://github.com/apache/parquet-format/pull/185#issuecomment-1340540614

   Thanks @emkornfield !


-- 
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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [parquet-format] gszadovszky commented on pull request #185: PARQUET-1222: [Format] Add details about sort order to README.md

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on PR #185:
URL: https://github.com/apache/parquet-format/pull/185#issuecomment-1341331959

   I don't feel it would require a formal vote. In my view it was more a missing part of the spec that is made clear. 
   It might worth a heads up on the dev list, 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: dev-unsubscribe@parquet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org