Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

nandorKollar
Copy link
Contributor

No description provided.

Copy link
Contributor

@gszadovszky gszadovszky left a 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()) {
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor

@zivanfi zivanfi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@gszadovszky gszadovszky left a 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

@asfgit asfgit closed this in da3e8eb Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants