diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java index 349f115..3541669 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java @@ -423,10 +423,6 @@ public int execute(DriverContext driverContext) { List> dps = Utilities.getFullDPSpecs(conf, dpCtx); - // publish DP columns to its subscribers - if (dps != null && dps.size() > 0) { - pushFeed(FeedType.DYNAMIC_PARTITIONS, dps); - } console.printInfo(System.getProperty("line.separator")); long startTime = System.currentTimeMillis(); // load the list of DP partitions and return the list of partition specs @@ -448,6 +444,11 @@ public int execute(DriverContext driverContext) { SessionState.get().getTxnMgr().getCurrentTxnId(), hasFollowingStatsTask(), work.getLoadTableWork().getWriteType()); + // publish DP columns to its subscribers + if (dps != null && dps.size() > 0) { + pushFeed(FeedType.DYNAMIC_PARTITIONS, dp); + } + String loadTime = "\t Time taken to load dynamic partitions: " + (System.currentTimeMillis() - startTime)/1000.0 + " seconds"; console.printInfo(loadTime); diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java index aa5d914..1892074 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java @@ -78,7 +78,7 @@ private static transient final Logger LOG = LoggerFactory.getLogger(StatsTask.class); private Table table; - private List> dpPartSpecs; + private Map, Partition> dpPartSpecs; public StatsTask() { super(); @@ -89,8 +89,7 @@ public StatsTask() { protected void receiveFeed(FeedType feedType, Object feedValue) { // this method should be called by MoveTask when there are dynamic partitions generated if (feedType == FeedType.DYNAMIC_PARTITIONS) { - assert feedValue instanceof List; - dpPartSpecs = (List>) feedValue; + dpPartSpecs = (Map, Partition>) feedValue; } } @@ -496,10 +495,7 @@ private String toString(Map parameters) { // If no dynamic partitions are generated, dpPartSpecs may not be initialized if (dpPartSpecs != null) { // load the list of DP partitions and return the list of partition specs - for (LinkedHashMap partSpec : dpPartSpecs) { - Partition partn = db.getPartition(table, partSpec, false); - list.add(partn); - } + list.addAll(dpPartSpecs.values()); } } else { // static partition Partition partn = db.getPartition(table, tbd.getPartitionSpec(), false);