diff --git a/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java b/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java index 42c415884a..9d23c13a63 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java @@ -606,10 +606,12 @@ void processDatabase(String dbName, ForkJoinPool tablePool) { LOG.error("Not updating database location for {} since an error was encountered. " + "The migration must be run again for this database.", dbObj.getName()); } else { - Path newDefaultDbLocation = wh.get().getDefaultDatabasePath(dbName); - // dbObj after this call would have the new DB location. - // Keep that in mind if anything below this requires the old DB path. - hiveUpdater.get().updateDbLocation(dbObj, newDefaultDbLocation); + if (!runOptions.dryRun) { + Path newDefaultDbLocation = wh.get().getDefaultDatabasePath(dbName); + // dbObj after this call would have the new DB location. + // Keep that in mind if anything below this requires the old DB path. + hiveUpdater.get().updateDbLocation(dbObj, newDefaultDbLocation); + } } } } catch (InterruptedException e) {