maheshk114 commented on a change in pull request #578: HIVE-21471: Replicating conversion of managed to external table leaks HDFS files at target. URL: https://github.com/apache/hive/pull/578#discussion_r268226195
########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java ########## @@ -209,7 +214,13 @@ public void alterTable(RawStore msdb, Warehouse wh, String catName, String dbnam boolean tableInSpecifiedLoc = !oldtRelativePath.equalsIgnoreCase(name) && !oldtRelativePath.equalsIgnoreCase(name + Path.SEPARATOR); - if (!tableInSpecifiedLoc) { + if (replDataLocationChanged) { + // If data location is changed in replication flow, then new path was already set in + // the newt. Also, it is as good as the data is moved and set dataWasMoved=true so that + // location in partitions are also updated accordingly. + destPath = new Path(newt.getSd().getLocation()); Review comment: Need to handle the scenario where the partition is not within table location ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services