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 2020/10/19 18:34:07 UTC

[GitHub] [parquet-mr] jmartone opened a new pull request #832: PARQUET-1926: Add LogicalType support to I64Type

jmartone opened a new pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832


   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Parquet Jira](https://issues.apache.org/jira/browse/PARQUET-1926/) issues and references them in the PR title. For example, "PARQUET-1234: My Parquet PR"
     - https://issues.apache.org/jira/browse/PARQUET-1926
     - 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).
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   ### 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.

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



[GitHub] [parquet-mr] gszadovszky commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r561796333



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       Why you don't like static imports? This change (and the removing of the related import) seems to be useless.




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

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



[GitHub] [parquet-mr] jmartone commented on pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
jmartone commented on pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#issuecomment-721799169


   Build errors appear to be due to a problem connection to a Twitter Maven repo:
   
   ```
   Failed to execute goal on project parquet-thrift: Could not resolve dependencies for project org.apache.parquet:parquet-thrift:jar:1.12.0-SNAPSHOT: Failed to collect dependencies at com.twitter.elephantbird:elephant-bird-pig:jar:4.4 -> com.twitter.elephantbird:elephant-bird-core:jar:4.4 -> com.hadoop.gplcompression:hadoop-lzo:jar:0.4.16: Failed to read artifact descriptor for com.hadoop.gplcompression:hadoop-lzo:jar:0.4.16: Could not transfer artifact com.hadoop.gplcompression:hadoop-lzo:pom:0.4.16 from/to twitter (http://maven.twttr.com): Transfer failed for http://maven.twttr.com/com/hadoop/gplcompression/hadoop-lzo/0.4.16/hadoop-lzo-0.4.16.pom 503 Service Temporarily Unavailable
   ```


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

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



[GitHub] [parquet-mr] gszadovszky commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r561796333



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       Why you don't like static imports? This change (and the removing of the related import) seems to be useless.

##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       Yes, I know what this PR is about. My comment was only about this line (and the removing of the static import).
   
   It is a matter of taste whether you like static imports or not and it is up to you if you use them or not. But modifying an existing line is another topic. I usually like to keep a change as small as possible and do not touch other code parts if it is not necessary.
   Anyway, if you have a strong opinion that this change improves readability I am fine with that too.




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

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



[GitHub] [parquet-mr] jmartone commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
jmartone commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r562035955



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       I find accessing these via `LogicalTypeAnnotation.enumType()` more clear than just `enumType()`. The larger change in this PR allows any thrift type to use a LogicalTypeAnnotation, so importing the class opens the door to further changes that implement these logical types.

##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       I remove this static import for consistency with the logical types in my changes. I do find qualifying the type with `LogicalTypeAnnotation.` improves readability.
   
   If we prefer a set of discrete static imports to importing the larger class I can certainly do that instead. My motivation was more concise imports and readability.




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

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



[GitHub] [parquet-mr] gszadovszky merged pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
gszadovszky merged pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832


   


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

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



[GitHub] [parquet-mr] jmartone commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
jmartone commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r562082846



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       I remove this static import for consistency with the logical types in my changes. I do find qualifying the type with `LogicalTypeAnnotation.` improves readability.
   
   If we prefer a set of discrete static imports to importing the larger class I can certainly do that instead. My motivation was more concise imports and readability.




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

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



[GitHub] [parquet-mr] gszadovszky commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r563543489



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       I accept it as a strong opinion :)




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

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



[GitHub] [parquet-mr] jmartone commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
jmartone commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r562035955



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       I find accessing these via `LogicalTypeAnnotation.enumType()` more clear than just `enumType()`. The larger change in this PR allows any thrift type to use a LogicalTypeAnnotation, so importing the class opens the door to further changes that implement these logical types.




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

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



[GitHub] [parquet-mr] gszadovszky commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r563543489



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       I accept it as a strong opinion :)




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

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



[GitHub] [parquet-mr] gszadovszky commented on a change in pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on a change in pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#discussion_r562061225



##########
File path: parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java
##########
@@ -325,7 +323,7 @@ private ConvertedField visitPrimitiveType(PrimitiveTypeName type, LogicalTypeAnn
 
   @Override
   public ConvertedField visit(EnumType enumType, State state) {
-    return visitPrimitiveType(BINARY, enumType(), state);
+    return visitPrimitiveType(BINARY, LogicalTypeAnnotation.enumType(), state);

Review comment:
       Yes, I know what this PR is about. My comment was only about this line (and the removing of the static import).
   
   It is a matter of taste whether you like static imports or not and it is up to you if you use them or not. But modifying an existing line is another topic. I usually like to keep a change as small as possible and do not touch other code parts if it is not necessary.
   Anyway, if you have a strong opinion that this change improves readability I am fine with that too.




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

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



[GitHub] [parquet-mr] jmartone commented on pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
jmartone commented on pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#issuecomment-722620161


   @Fokko I've made this change a little more general to allow users to add LogicalTypes to any ThriftType. I've also added tests but the build appears to be failing due to some transient problem with getting a dependency. Do I need to re-run the build?


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

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



[GitHub] [parquet-mr] gszadovszky commented on pull request #832: PARQUET-1926: Add LogicalType support to ThriftType

Posted by GitBox <gi...@apache.org>.
gszadovszky commented on pull request #832:
URL: https://github.com/apache/parquet-mr/pull/832#issuecomment-724154756


   @jmartone, I don't think the build would pass if you re-run it. I've started a thread on the dev list about [this topic](http://mail-archives.apache.org/mod_mbox//parquet-dev/202011.mbox/%3CCAAhnZP65iDNS9kHoaJej6iJrAyHag8tZTA0MZQ6xePcN3j9Twg%40mail.gmail.com%3E).


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

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