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..e1381be 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.values()); + } + 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..c22d69b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java @@ -21,6 +21,7 @@ import java.io.Serializable; import java.util.ArrayList; +import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -78,7 +79,7 @@ private static transient final Logger LOG = LoggerFactory.getLogger(StatsTask.class); private Table table; - private List> dpPartSpecs; + private Collection dpPartSpecs; public StatsTask() { super(); @@ -89,8 +90,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 = (Collection) feedValue; } } @@ -496,10 +496,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); } } else { // static partition Partition partn = db.getPartition(table, tbd.getPartitionSpec(), false);