Skip to content

HIVE-29046: Avoid unecessary perf overhead from handling deprecated properties in MetastoreConf #5897

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

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

Conversation

zabetak
Copy link
Member

@zabetak zabetak commented Jun 25, 2025

What changes were proposed in this pull request?

  1. Move deprecated property registation in the existing static block
  2. Drop constructors and variables related to deprecated keys in ConfVars
  3. Drop DEPRECATED_TEST_ENTRY that is only useful for testing purposes and adapt existing tests

Why are the changes needed?

Improve performance & code maintenance.

Looping through ~400 ConfVars enumeration entries on every creation of a new Configuration entry is resource wasteful and unecessary. The deprecated properties are static and known at compile time so there is no reason to search and register them on every creation of a new Configuration instance. In addition, the presence of deprecation information inside the ConfVars enumeration leads to boilerplate code that is not really necessary.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests

…roperties in MetastoreConf

Looping through ~400 ConfVars enumeration entries on every creation of a new Configuration entry is resource wasteful and unecessary.
The deprecated properties are static and known at compile time so there is no reason to search and register them on every creation of a new Configuration instance.
In addition, the presence of deprecation information inside the ConfVars enumeration leads to boilerplate code that is not really necessary.

1. Move deprecated property registation in the existing static block
2. Drop constructors and variables related to deprecated keys in ConfVars
3. Drop DEPRECATED_TEST_ENTRY that is only useful for testing purposes and adapt existing tests
Copy link

@@ -128,6 +128,13 @@ public class MetastoreConf {
keyToVars.put(var.varname, var);
keyToVars.put(var.hiveName, var);
}
Configuration.addDeprecations(new Configuration.DeprecationDelta[] {
Copy link
Member

Choose a reason for hiding this comment

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

can we just drop them in Hive-4.1?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't have a policy in place about when and how to remove deprecated props so its our call. Personally, my goal here is to avoid the unnecessary perf hit so I don't mind removing them completely if you prefer this path.

Most often, when projects follow semantic versioning breaking changes only happen during major version bumps so ideally the removal should happen in 5.x. In Hive, we are not so dogmatic about it so I think we can afford such small breaking changes even in minor version bumps.

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