Index: ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java =================================================================== --- ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java (revision 988835) +++ ant/src/org/apache/hadoop/hive/ant/QTestGenTask.java (working copy) @@ -81,6 +81,8 @@ private String queryDirectory; private String queryFile; + + private String excludeQueryFile; private String queryFileRegex; @@ -193,11 +195,19 @@ public String getQueryFile() { return queryFile; } - + + public void setExcludeQueryFile(String excludeQueryFile) { + this.excludeQueryFile = excludeQueryFile; + } + + public String getExcludeQueryFile() { + return excludeQueryFile; + } + public void setQueryFileRegex(String queryFileRegex) { this.queryFileRegex = queryFileRegex; } - + public String getQueryFileRegex() { return queryFileRegex; } @@ -257,6 +267,17 @@ } else { qFiles.addAll(Arrays.asList(inpDir.listFiles(new QFileFilter()))); } + + if (excludeQueryFile != null && !excludeQueryFile.equals("")) { + // Exclude specified query files, comma separated + for (String qFile : excludeQueryFile.split(",")) { + if (null != inpDir) { + qFiles.remove(new File(inpDir, qFile)); + } else { + qFiles.remove(new File(qFile)); + } + } + } Collections.sort(qFiles); Index: build.xml =================================================================== --- build.xml (revision 988835) +++ build.xml (working copy) @@ -342,16 +342,16 @@ - + - + - + Index: data/conf/hive-site.xml =================================================================== --- data/conf/hive-site.xml (revision 988835) +++ data/conf/hive-site.xml (working copy) @@ -73,18 +73,6 @@ - fs.default.name - file:/// - - - - - mapred.job.tracker - local - - - - test.log.dir ${build.dir}/test/logs Index: build-common.xml =================================================================== --- build-common.xml (revision 988835) +++ build-common.xml (working copy) @@ -50,7 +50,7 @@ - + @@ -330,16 +330,6 @@ - - - - - - - - - - @@ -399,6 +389,9 @@ + + + - + + + Index: ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java =================================================================== --- ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java (revision 988835) +++ ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java (working copy) @@ -194,14 +194,17 @@ return null; } - public void initConf() { + public void initConf() throws Exception { if (miniMr) { - String fsName = conf.get("fs.default.name"); - assert fsName != null; - // hive.metastore.warehouse.dir needs to be set relative to the jobtracker - conf.set("hive.metastore.warehouse.dir", fsName - .concat("/build/ql/test/data/warehouse/")); - conf.set("mapred.job.tracker", "localhost:" + mr.getJobTrackerPort()); + assert dfs != null; + assert mr != null; + // set fs.default.name to the uri of mini-dfs + conf.setVar(HiveConf.ConfVars.HADOOPFS, dfs.getFileSystem().getUri().toString()); + // hive.metastore.warehouse.dir needs to be set relative to the mini-dfs + conf.setVar(HiveConf.ConfVars.METASTOREWAREHOUSE, + (new Path(dfs.getFileSystem().getUri().toString(), + "/build/ql/test/data/warehouse/")).toString()); + conf.setVar(HiveConf.ConfVars.HADOOPJT, "localhost:" + mr.getJobTrackerPort()); } } @@ -330,7 +333,6 @@ } public void cleanUp() throws Exception { - String warehousePath = ((new URI(testWarehouse)).getPath()); // Drop any tables that remain due to unsuccessful runs for (String s : new String[] {"src", "src1", "src_json", "src_thrift", "src_sequencefile", "srcpart", "srcbucket", "srcbucket2", "dest1", @@ -338,9 +340,15 @@ "dest_g1", "dest_g2", "fetchtask_ioexception"}) { db.dropTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, s); } - for (String s : new String[] {"dest4.out", "union.out"}) { - deleteDirectory(new File(warehousePath, s)); + + // delete any contents in the warehouse dir + Path p = new Path(testWarehouse); + FileSystem fs = p.getFileSystem(conf); + FileStatus [] ls = fs.listStatus(p); + for (int i=0; (ls != null) && (i + @@ -48,6 +49,7 @@ + @@ -86,6 +88,7 @@ templatePath="${ql.test.template.dir}" template="TestCliDriver.vm" queryDirectory="${ql.test.query.clientpositive.dir}" queryFile="${qfile}" + excludeQueryFile="${ql.test.clientpositive.exclude}" queryFileRegex="${qfile_regex}" clusterMode="${clustermode}" resultsDirectory="${ql.test.results.clientpositive.dir}" className="TestCliDriver" @@ -95,6 +98,18 @@ /> + +