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

Fix primitive serialization #162

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

koboldunderlord
Copy link

Attempt #2.

Hive handles primitive types using the base Hadoop writable rather than
its own during joins, which means that in order to use the proper
DoubleWritable class from Hive you have to actually return an object of
the appropriate type in JsonSerDe.serializeField instead of a primitive.

Hive handles primitive types using the base Hadoop writable rather than
its own during joins, which means that in order to use the proper
DoubleWritable class from Hive you have to actually return an object of
the appropriate type in JsonSerDe.serializeField instead of a primitive.
@koboldunderlord koboldunderlord changed the base branch from master to develop August 30, 2016 23:54
@@ -302,22 +302,22 @@ public Object serializeField(Object obj,
Boolean.FALSE;
break;
case BYTE:
result = ((ByteObjectInspector)poi).get(obj);
result = Byte.valueOf(((ByteObjectInspector)poi).get(obj));
break;
Copy link
Owner

Choose a reason for hiding this comment

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

Since result is an object, not a primitive, Java autoboxing takes care of that automatically.
See http://docs.oracle.com/javase/tutorial/java/data/autoboxing.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants