Author: gunther Date: Fri Nov 1 00:48:55 2013 New Revision: 1537786 URL: http://svn.apache.org/r1537786 Log: HIVE-5703: While using tez, Qtest needs to close session before creating a new one (Vikram Dixit K via Gunther Hagleitner)
Modified: hive/branches/tez/ql/build.xml hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java Modified: hive/branches/tez/ql/build.xml URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/build.xml?rev=1537786&r1=1537785&r2=1537786&view=diff ============================================================================== --- hive/branches/tez/ql/build.xml (original) +++ hive/branches/tez/ql/build.xml Fri Nov 1 00:48:55 2013 @@ -139,7 +139,6 @@ <if> <equals arg1="${hadoop.mr.rev}" arg2="23"/> <then> - <echo message="hadoop mr rev: ${hadoop.mr.rev}"/> <qtestgen hiveRootDirectory="${hive.root}" outputDirectory="${test.build.src}/org/apache/hadoop/hive/cli" templatePath="${ql.test.template.dir}" template="TestCliDriver.vm" Modified: hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java URL: http://svn.apache.org/viewvc/hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java?rev=1537786&r1=1537785&r2=1537786&view=diff ============================================================================== --- hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java (original) +++ hive/branches/tez/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java Fri Nov 1 00:48:55 2013 @@ -114,6 +114,7 @@ public class QTestUtil { "src_sequencefile", "srcpart", "alltypesorc" })); + private static MiniClusterType clusterType = MiniClusterType.none; private ParseDriver pd; private Hive db; protected HiveConf conf; @@ -313,6 +314,7 @@ public class QTestUtil { qMap = new TreeMap<String, String>(); qSkipSet = new HashSet<String>(); qSortSet = new HashSet<String>(); + this.clusterType = clusterType; HadoopShims shims = null; switch (clusterType) { @@ -790,6 +792,11 @@ public class QTestUtil { ss.err = new CachingPrintStream(fo, true, "UTF-8"); ss.setIsSilent(true); SessionState oldSs = SessionState.get(); + + if (oldSs != null && clusterType == MiniClusterType.tez) { + oldSs.close(); + } + if (oldSs != null && oldSs.out != null && oldSs.out != System.out) { oldSs.out.close(); }