diff --git data/conf/hive-site.xml data/conf/hive-site.xml index 7a69711..62364fe 100644 --- data/conf/hive-site.xml +++ data/conf/hive-site.xml @@ -70,7 +70,7 @@ javax.jdo.option.ConnectionURL - jdbc:derby:;databaseName=${test.tmp.dir}/junit_metastore_db;create=true + jdbc:derby:memory:${test.tmp.dir}/junit_metastore_db;create=true diff --git ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java index 2d1ecb5..34d16b5 100644 --- ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java +++ ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTest.java @@ -102,6 +102,11 @@ protected CompactorTest() throws Exception { tmpdir.deleteOnExit(); } + protected void deleteTableDir(String tableName) throws IOException { + FileSystem fs = FileSystem.get(conf); + fs.delete(new Path(getLocation(tableName, null)), true); + } + protected void startInitiator() throws Exception { startThread('i', true); } diff --git ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java index e85f49c..0b3321e 100644 --- ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java +++ ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java @@ -441,6 +441,7 @@ public void minorPartitionWithBase() throws Exception { @Test public void minorTableNoBase() throws Exception { LOG.debug("Starting minorTableWithBase"); + deleteTableDir("mtnb"); Table t = newTable("default", "mtnb", false); addDeltaFile(t, null, 1L, 2L, 2); @@ -484,6 +485,7 @@ public void minorTableNoBase() throws Exception { @Test public void majorTableWithBase() throws Exception { LOG.debug("Starting majorTableWithBase"); + deleteTableDir("matwb"); Table t = newTable("default", "matwb", false); addBaseFile(t, null, 20L, 20); @@ -630,6 +632,7 @@ else if(stat[i].getPath().getName().equals(makeDeltaDirNameCompacted(25,33))) { @Test public void majorPartitionWithBase() throws Exception { LOG.debug("Starting majorPartitionWithBase"); + deleteTableDir("mapwb"); Table t = newTable("default", "mapwb", true); Partition p = newPartition(t, "today"); @@ -676,6 +679,7 @@ public void majorPartitionWithBase() throws Exception { @Test public void majorTableNoBase() throws Exception { LOG.debug("Starting majorTableNoBase"); + deleteTableDir("matnb"); Table t = newTable("default", "matnb", false); addDeltaFile(t, null, 1L, 2L, 2); @@ -763,6 +767,7 @@ public void majorTableLegacy() throws Exception { @Test public void minorTableLegacy() throws Exception { LOG.debug("Starting minorTableLegacy"); + deleteTableDir("mtl"); Table t = newTable("default", "mtl", false); addLegacyFile(t, null, 20); @@ -804,6 +809,7 @@ public void minorTableLegacy() throws Exception { @Test public void majorPartitionWithBaseMissingBuckets() throws Exception { LOG.debug("Starting majorPartitionWithBaseMissingBuckets"); + deleteTableDir("mapwbmb"); Table t = newTable("default", "mapwbmb", true); Partition p = newPartition(t, "today");