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 90dc4a31bc..2b2cc1a2ba 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 @@ -211,7 +211,7 @@ private void overrideMRProps(JobConf job, Map properties) { * @throws java.io.IOException if the job fails */ void run(HiveConf conf, String jobName, Table t, Partition p, StorageDescriptor sd, ValidWriteIdList writeIds, - CompactionInfo ci, Worker.StatsUpdater su, IMetaStoreClient msc) throws IOException { + CompactionInfo ci, Worker.StatsUpdater su, IMetaStoreClient msc, Directory dir) throws IOException { if(conf.getBoolVar(HiveConf.ConfVars.HIVE_IN_TEST) && conf.getBoolVar(HiveConf.ConfVars.HIVETESTMODEFAILCOMPACTION)) { throw new RuntimeException(HiveConf.ConfVars.HIVETESTMODEFAILCOMPACTION.name() + "=true"); @@ -233,14 +233,10 @@ void run(HiveConf conf, String jobName, Table t, Partition p, StorageDescriptor JobConf job = createBaseJobConf(conf, jobName, t, sd, writeIds, ci); - // Figure out and encode what files we need to read. We do this here (rather than in - // getSplits below) because as part of this we discover our minimum and maximum transactions, + // Figure out and encode what files we need to read. We do this before getSplits + // because as part of this we discover our minimum and maximum transactions, // and discovering that in getSplits is too late as we then have no way to pass it to our // mapper. - - AcidUtils.Directory dir = AcidUtils.getAcidState(null, new Path(sd.getLocation()), conf, writeIds, Ref.from(false), true, - null, false); - List parsedDeltas = dir.getCurrentDirectories(); int maxDeltasToHandle = conf.getIntVar(HiveConf.ConfVars.COMPACTOR_MAX_NUM_DELTA); if (parsedDeltas.size() > maxDeltasToHandle) { diff --git ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java index b1493556fe..5aff71e0e9 100644 --- ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java +++ ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java @@ -206,7 +206,7 @@ public void run() { launchedJob = true; try { if (runJobAsSelf(ci.runAs)) { - mr.run(conf, jobName.toString(), t, p, sd, tblValidWriteIds, ci, su, msc); + mr.run(conf, jobName.toString(), t, p, sd, tblValidWriteIds, ci, su, msc, dir); } else { UserGroupInformation ugi = UserGroupInformation.createProxyUser(t.getOwner(), UserGroupInformation.getLoginUser()); @@ -214,7 +214,7 @@ public void run() { ugi.doAs(new PrivilegedExceptionAction() { @Override public Object run() throws Exception { - mr.run(conf, jobName.toString(), t, fp, sd, tblValidWriteIds, ci, su, msc); + mr.run(conf, jobName.toString(), t, fp, sd, tblValidWriteIds, ci, su, msc, dir); return null; } });