rtrivedi12 commented on code in PR #4304:
URL: https://github.com/apache/hive/pull/4304#discussion_r1258106621
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/drop/DropTableAnalyzer.java:
##########
@@ -46,9 +48,16 @@ public DropTableAnalyzer(QueryState queryState) throws
SemanticException {
@Override
public void analyzeInternal(ASTNode root) throws SemanticException {
- String tableName = getUnescapedName((ASTNode) root.getChild(0));
+ TableName qualTabName = getQualifiedTableName((ASTNode) root.getChild(0));
+ String tableName = qualTabName.getNotEmptyDbTable();
boolean ifExists = (root.getFirstChildWithType(HiveParser.TOK_IFEXISTS) !=
null);
boolean throwException = !ifExists && !HiveConf.getBoolVar(conf,
ConfVars.DROP_IGNORES_NON_EXISTENT);
+ //Authorize database for drop table command
+ // Skip db object if database doesn't exist
+ Database database = getDatabase(qualTabName.getDb(),false);
Review Comment:
@zabetak In case of the DROP TABLE IF EXISTS command, this `throwException`
refers to throwing exception in case of a non-existent table during the
`getTable` parameter. As we want NOOP in case of non-existent DB in DROP TABLE,
hardcoded this as false for `getDatabase` call
--
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]