New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PARQUET-357: Parquet-thrift generates wrong schema for Thrift binary fields #439
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 2 nits.
LGTM otherwise.
@@ -163,6 +163,9 @@ private static ThriftField toThriftField(String name, Field field, ThriftField.R | |||
break; | |||
case STRING: | |||
type = new StringType(); | |||
if (field.getFieldMetaData() != null && field.getFieldMetaData().valueMetaData.isBinary()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest using local variables instead of testing a getter return to null and then invoke the same getter again.
@@ -163,6 +163,9 @@ private static ThriftField toThriftField(String name, Field field, ThriftField.R | |||
break; | |||
case STRING: | |||
type = new StringType(); | |||
if (field.getFieldMetaData() != null && field.getFieldMetaData().valueMetaData.isBinary()) { | |||
((StringType) type).setBinary(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more readable if a separate local variable would contain a StringType
(so no casting would be needed) and then set the value of this variable to type
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the changes
No description provided.