Skip to content

HIVE-28846: change default value of ifExist in dropCatalogRequest to … #5713

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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

jjiang037
Copy link
Contributor

@jjiang037 jjiang037 commented Mar 24, 2025

…be true

What changes were proposed in this pull request?

Set ifExist default value to be true in DropCatalogRequest

Why are the changes needed?

This is a follow-up improvement for the ticket: https://issues.apache.org/jira/browse/HIVE-28443

Set ifExist default value to be true to ensure it doesn't throw exception.

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

Unit test added

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the DropCatalogRequest default behavior so that its ifExists flag now defaults to true, preventing exceptions when dropping a non-existent catalog.

  • Updated default value for ifExists in generated Thrift files for Python, Ruby, and JavaBean.
  • Adjusted tests in TestCatalogs.java to differentiate behavior when ifExists is false versus true.

Reviewed Changes

Copilot reviewed 4 out of 7 changed files in this pull request and generated no comments.

File Description
standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py Updated default value for ifExists in Python generated code
standalone-metastore/metastore-common/src/gen/thrift/gen-rb/hive_metastore_types.rb Updated default value for ifExists in Ruby generated code
standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DropCatalogRequest.java Set default ifExists to true in constructor and clear method
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestCatalogs.java Modified tests to reflect the new behavior for dropCatalog
Files not reviewed (3)
  • standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/hive_metastore_types.h: Language not supported
  • standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/DropCatalogRequest.php: Language not supported
  • standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift: Language not supported
Comments suppressed due to low confidence (1)

standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestCatalogs.java:202

  • [nitpick] The use of Assert.assertTrue with a constant true is redundant given the @test(expected = ...) annotation. Consider removing or replacing it with a fail() call to make the test intent clearer if no exception is thrown.
Assert.assertTrue("dropCatalog completed without throwing an exception", true);

Copy link
Contributor

@zhangbutao zhangbutao left a comment

Choose a reason for hiding this comment

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

+1 LGTM

@saihemanth-cloudera saihemanth-cloudera merged commit ed1a32c into apache:master Mar 27, 2025
6 checks passed
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.

5 participants