Index: ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java (revision 6469) +++ ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java (working copy) @@ -31,6 +31,7 @@ import java.util.Map; import java.util.Queue; import java.util.Set; +import java.util.Random; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -61,17 +62,19 @@ private static final Log LOG = LogFactory.getLog(QueryPlan.class.getName()); + public static Random randGen = new Random(); + private String queryString; private ArrayList> rootTasks; private FetchTask fetchTask; - + private HashSet inputs; /** * Note: outputs are not all determined at compile time. * Some of the tasks can change the outputs at run time, because only at run - * time, we know what are the changes. These tasks should keep a reference - * to the outputs here. + * time, we know what are the changes. These tasks should keep a reference + * to the outputs here. */ private HashSet outputs; /** @@ -128,13 +131,15 @@ + String.format("%1$4d%2$02d%3$02d%4$02d%5$02d%5$02d", gc .get(Calendar.YEAR), gc.get(Calendar.MONTH) + 1, gc .get(Calendar.DAY_OF_MONTH), gc.get(Calendar.HOUR_OF_DAY), gc - .get(Calendar.MINUTE), gc.get(Calendar.SECOND)); + .get(Calendar.MINUTE), gc.get(Calendar.SECOND)) + + "_" + + randGen.nextInt(); } /** * generate the operator graph and operator list for the given task based on * the operators corresponding to that task. - * + * * @param task * api.Task which needs its operator graph populated * @param topOps @@ -182,7 +187,7 @@ /** * Populate api.QueryPlan from exec structures. This includes constructing the * dependency graphs of stages and operators. - * + * * @throws IOException */ private void populateQueryPlan() throws IOException { @@ -719,19 +724,19 @@ /** * Gets the lineage information. - * + * * @return LineageInfo associated with the query. */ public LineageInfo getLineageInfo() { return linfo; } - + /** * Sets the lineage information. - * + * * @param linfo The LineageInfo structure that is set in the optimization phase. */ public void setLineageInfo(LineageInfo linfo) { this.linfo = linfo; - } + } }