Select correct ObjectInspector based on Hive version on classpath#1632
Merged
rdblue merged 2 commits intoapache:masterfrom Oct 19, 2020
Merged
Select correct ObjectInspector based on Hive version on classpath#1632rdblue merged 2 commits intoapache:masterfrom
rdblue merged 2 commits intoapache:masterfrom
Conversation
massdosage
approved these changes
Oct 19, 2020
Contributor
massdosage
left a comment
There was a problem hiding this comment.
I just tested this on our cluster and it fixes the issue I reported.
rdblue
reviewed
Oct 19, 2020
mr/src/main/java/org/apache/iceberg/mr/hive/serde/objectinspector/IcebergObjectInspector.java
Outdated
Show resolved
Hide resolved
rdblue
reviewed
Oct 19, 2020
Contributor
There was a problem hiding this comment.
It seems like it would be a bit easier to read if you didn't wrap the DynMethods call and instead just swapped out the class:
private static final TIMESTAMP_INSPECTOR_CLASS = MetastoreUtil.hive3PresentOnClasspath() ?
"org.apache.iceberg.mr.hive.serde.objectinspector.IcebergTimestampObjectInspector" :
"org.apache.iceberg.mr.hive.serde.objectinspector.IcebergTimestampObjectInspectorHive3";
private static final ObjectInspector TIMESTAMP_INSPECTOR = DynMethods.builder("get")
.impl(TIMESTAMP_INSPECTOR_CLASS, boolean.class)
.buildStatic()
.invoke(false);That way you don't need all of the inline array literals.
Collaborator
Author
There was a problem hiding this comment.
yep...much simpler, thanks:)
changed it
Contributor
|
Thanks for the fix! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To fix #1630, the ObjectInspector selection logic needs to depend on checking the presence of Hive3 classes on the classpath.
cc @rdblue @massdosage @pvary - thanks for checking!