Skip to content

Conversation

@sunchao
Copy link
Member

@sunchao sunchao commented Nov 25, 2020

What changes were proposed in this pull request?

This backports #1621 to branch-3.1.

This mainly replace JsonProperties.getJsonProp with JsonProperties.getObjectProp.

Note that there's one place in SchemaToTypeInfo where we explicitly call getIntValue to forbid string as precision/scale values (see HIVE-7174). To retain the old behavior, we check if the returned object is integer type, and if not, return a default 0 following JsonNode implementation.

Why are the changes needed?

JsonProperties#getJsonProp has been marked as deprecated in Avro 1.8 and removed since Avro 1.9. This replaces the API usage for this with getObjectProp which doesn't leak Json node from jackson. This will help downstream apps to depend on Hive while using higher version of Avro, and also help Hive to upgrade Avro version itself.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.

Copy link
Member

@szehon-ho szehon-ho left a comment

Choose a reason for hiding this comment

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

+1 , looks like a pretty clean backport

@sunchao sunchao merged commit a2d82a7 into apache:branch-3.1 Aug 10, 2021
@sunchao
Copy link
Member Author

sunchao commented Aug 10, 2021

Thanks @szehon-ho !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants