diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index 714ea1f3fd..ad5b3a3098 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -4198,7 +4198,7 @@ private void dropPartitions(Hive db, Table tbl, DropTableDesc dropTbl) throws Hi private void dropTable(Hive db, Table tbl, DropTableDesc dropTbl) throws HiveException { // This is a true DROP TABLE - if (tbl != null && dropTbl.getExpectedType() != null) { + if (tbl != null && dropTbl.getValidationRequired()) { if (tbl.isView()) { if (!dropTbl.getExpectView()) { if (dropTbl.getIfExists()) { diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/DropTableHandler.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/DropTableHandler.java index d2f5248a2d..4d400f4af6 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/DropTableHandler.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/DropTableHandler.java @@ -37,7 +37,7 @@ String actualTblName = context.isTableNameEmpty() ? msg.getTable() : context.tableName; DropTableDesc dropTableDesc = new DropTableDesc( actualDbName + "." + actualTblName, - null, true, true, context.eventOnlyReplicationSpec() + null, true, true, context.eventOnlyReplicationSpec(), false ); Task dropTableTask = TaskFactory.get( new DDLWork(readEntitySet, writeEntitySet, dropTableDesc), diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/DropTableDesc.java b/ql/src/java/org/apache/hadoop/hive/ql/plan/DropTableDesc.java index b99f5bc869..aa5aa21cd9 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/plan/DropTableDesc.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/DropTableDesc.java @@ -58,6 +58,7 @@ public int getPrefixLength() { boolean ifExists; boolean ifPurge; ReplicationSpec replicationSpec; + boolean validationRequired; public DropTableDesc() { @@ -70,16 +71,28 @@ public DropTableDesc() { public DropTableDesc( String tableName, TableType expectedType, boolean ifExists, boolean ifPurge, ReplicationSpec replicationSpec) { + this(tableName, expectedType, ifExists, ifPurge, replicationSpec, true); + } + + public DropTableDesc( + String tableName, TableType expectedType, boolean ifExists, + boolean ifPurge, ReplicationSpec replicationSpec, boolean validationRequired) { this.tableName = tableName; this.partSpecs = null; this.expectedType = expectedType; this.ifExists = ifExists; this.ifPurge = ifPurge; this.replicationSpec = replicationSpec; + this.validationRequired = validationRequired; } public DropTableDesc(String tableName, Map> partSpecs, TableType expectedType, boolean ifPurge, ReplicationSpec replicationSpec) { + this(tableName, partSpecs, expectedType, ifPurge, replicationSpec, true); + } + + public DropTableDesc(String tableName, Map> partSpecs, + TableType expectedType, boolean ifPurge, ReplicationSpec replicationSpec, boolean validationRequired) { this.tableName = tableName; this.partSpecs = new ArrayList(partSpecs.size()); for (Map.Entry> partSpec : partSpecs.entrySet()) { @@ -91,6 +104,7 @@ public DropTableDesc(String tableName, Map