Skip to content

Conversation

@sunchao
Copy link
Member

@sunchao sunchao commented Nov 13, 2020

What changes were proposed in this pull request?

This backports #1621 to branch-2.3.

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.

@sunchao
Copy link
Member Author

sunchao commented Nov 13, 2020

cc @szehon-ho @aihuaxu could you review this? thanks.

@sunchao
Copy link
Member Author

sunchao commented Nov 17, 2020

Thanks @aihuaxu ! Test failures unrelated. Merging to branch-2.3 now.

@sunchao sunchao merged commit 01c72d2 into apache:branch-2.3 Nov 17, 2020
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