Skip to content

HIVE-29244: Add catalog field into ShowLocksRequest#6314

Open
Neer393 wants to merge 1 commit intoapache:masterfrom
Neer393:HIVE-29244
Open

HIVE-29244: Add catalog field into ShowLocksRequest#6314
Neer393 wants to merge 1 commit intoapache:masterfrom
Neer393:HIVE-29244

Conversation

@Neer393
Copy link
Contributor

@Neer393 Neer393 commented Feb 11, 2026

What changes were proposed in this pull request?

Modified SHowLocksRequest and ShowLocksResponse to include the catalog name and modified the grammar to accept catalog name for getting locks. Added a catalog field to the HMS HIVE_LOCKS table for 4.3.0 and added an alter statement for upgrading from 4.2.0 to 4.3.0

Why are the changes needed?

The changes are needed so that now user can view locks on tables and databases across catalogs.

Does this PR introduce any user-facing change?

No user facing change

How was this patch tested?

Checked the HIVE_LOCKS table and it had the Catalog column and also tried SHOW LOCKS DATABASE dbname; which displayed the catalog column as well. Also tried out SHOW LOCKS DATABASE catname.dbname;

Copy link

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

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

Copilot reviewed 84 out of 84 changed files in this pull request and generated 13 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


components.add(createLockComponent(LockType.SHARED_WRITE, LockLevel.DB, "mydb", "mytable", null, DataOperationType.UPDATE));
components.add(createLockComponent(LockType.SHARED_WRITE, LockLevel.DB, "mydb", "yourtable", "mypartition=myvalue", DataOperationType.UPDATE));
components.add(createLockComponent(LockType.SHARED_WRITE, LockLevel.DB, "hive", "mydb",
Copy link
Member

Choose a reason for hiding this comment

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

what is the point doing doing changes here. can't you just use hive hardcode in createLockComponent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I did think of it but say in future new tests added to this file wants to create a lock component on some table that is not in hive catalog some new catalog. In that case this method won't be usable. Just for extensibility sake I have modified the usages.

If you want, I can hardcode hive in createLockComponent method itself.

@@ -1,3 +1,5 @@
SELECT 'Upgrading MetaStore schema from 4.2.0 to 4.3.0';

ALTER TABLE `HIVE_LOCKS` ADD COLUMNS (`HL_CATALOG` string);
Copy link
Member

Choose a reason for hiding this comment

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

i don't think it's a good idea to use full catalog name here instead of FK reference

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I did think of same but then I saw the current implementation like we could have done the same i.e create FK reference for db and table as well but I see the current implementation stores the names and not reference as string so I decided to stick with it.

@Neer393
Copy link
Contributor Author

Neer393 commented Mar 3, 2026

Changes have been made as per the comments.
Please re-review it @zhangbutao @deniskuzZ

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.

@Neer393 Change looks good to me. Thanks @Neer393 .Waiting for @deniskuzZ to take a look.

Copy link

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

Copilot reviewed 82 out of 85 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

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.

7 participants