diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index 1655f3d..d3b6c15 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -3617,9 +3617,11 @@ private int alterTableOrSinglePartition(AlterTableDesc alterTbl, Table tbl, Part private void dropTableOrPartitions(Hive db, DropTableDesc dropTbl) throws HiveException { // We need to fetch the table before it is dropped so that it can be passed to // post-execution hook + boolean throwException = + !dropTbl.getIfExists() && !HiveConf.getBoolVar(conf, ConfVars.DROPIGNORESNONEXISTENT); Table tbl = null; try { - tbl = db.getTable(dropTbl.getTableName()); + tbl = db.getTable(dropTbl.getTableName(), throwException); } catch (InvalidTableException e) { // drop table is idempotent }