Skip to content

Conversation

@sunchao
Copy link
Member

@sunchao sunchao commented Oct 28, 2020

What changes were proposed in this pull request?

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 sunchao changed the title HIVE_24324: Remove deprecated API usage from Avro HIVE-24324: Remove deprecated API usage from Avro Nov 3, 2020
@sunchao
Copy link
Member Author

sunchao commented Nov 3, 2020

Thanks Aihua for +1 from the JIRA. Merging to master.

@sunchao sunchao merged commit f26fe63 into apache:master Nov 3, 2020
VPriesnitz pushed a commit to VPriesnitz/hive that referenced this pull request Nov 3, 2020
sunchao added a commit to sunchao/hive that referenced this pull request Nov 13, 2020
szehon-ho pushed a commit to szehon-ho/hive that referenced this pull request Nov 25, 2020
sunchao added a commit to sunchao/hive that referenced this pull request Nov 25, 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.

2 participants