deniskuzZ commented on code in PR #6088:
URL: https://github.com/apache/hive/pull/6088#discussion_r2454590955
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/database/unlock/UnlockDatabaseAnalyzer.java:
##########
@@ -41,14 +43,19 @@ public UnlockDatabaseAnalyzer(QueryState queryState) throws
SemanticException {
@Override
public void analyzeInternal(ASTNode root) throws SemanticException {
- String databaseName = unescapeIdentifier(root.getChild(0).getText());
+ Pair<String, String> catDbNamePair = getCatDbNamePair((ASTNode)
root.getChild(0));
+ String catalogName = catDbNamePair.getLeft();
+ if (catalogName != null && getCatalog(catalogName) == null) {
+ throw new SemanticException(ErrorMsg.CATALOG_NOT_EXISTS, catalogName);
+ }
+ String databaseName = catDbNamePair.getRight();
- inputs.add(new ReadEntity(getDatabase(databaseName)));
+ inputs.add(new ReadEntity(getDatabase(catalogName, databaseName, true)));
// Unlock database operation is to release the lock explicitly, the
operation itself don't need to be locked.
// Set the WriteEntity as WriteType: DDL_NO_LOCK here, otherwise it will
conflict with Hive's transaction.
- outputs.add(new WriteEntity(getDatabase(databaseName),
WriteType.DDL_NO_LOCK));
+ outputs.add(new WriteEntity(getDatabase(catalogName, databaseName, true),
WriteType.DDL_NO_LOCK));
Review Comment:
HIVE_LOCKS table doesn't have catalog column. Maybe some operation like
Unlock/Lock DB should only be supported by NATIVE DBs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]