diff --git ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorMR.java ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorMR.java index ac80bd1ebe..e5f30473ee 100644 --- ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorMR.java +++ ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorMR.java @@ -547,8 +547,8 @@ private String buildCrudMajorCompactionQuery(HiveConf conf, Table t, Partition p * {@link org.apache.hadoop.hive.ql.exec.tez.SplitGrouper#getCompactorSplitGroups(InputSplit[], Configuration)}, * we will end up with one file per bucket. */ - private void commitCrudMajorCompaction(Table t, String from, String tmpTableName, String to, Configuration conf, - ValidWriteIdList actualWriteIds, long compactorTxnId) throws IOException { + private void commitCrudMajorCompaction(Table t, String from, String tmpTableName, String to, HiveConf conf, + ValidWriteIdList actualWriteIds, long compactorTxnId) throws IOException, HiveException { Path fromPath = new Path(from); Path toPath = new Path(to); Path tmpTablePath = new Path(fromPath, tmpTableName); @@ -580,7 +580,7 @@ private void commitCrudMajorCompaction(Table t, String from, String tmpTableName options = new AcidOutputFormat.Options(conf).writingBase(true).isCompressed(false).maximumWriteId(maxTxn) .bucket(bucketId).statementId(-1).visibilityTxnId(compactorTxnId); Path finalBucketFile = AcidUtils.createFilename(toPath, options); - fs.rename(filestatus.getPath(), finalBucketFile); + Hive.moveFile(conf, filestatus.getPath(), finalBucketFile, true, false, false); } } fs.delete(fromPath, true);