Index: ant/checkstyle.xml =================================================================== --- ant/checkstyle.xml (revision 1390047) +++ ant/checkstyle.xml (working copy) @@ -18,13 +18,15 @@ --> - + + + - + Index: ant/test.xml =================================================================== --- ant/test.xml (revision 1390047) +++ ant/test.xml (working copy) @@ -18,13 +18,12 @@ --> - - + Index: src/test/org/apache/hcatalog/mapreduce/HCatBaseTest.java =================================================================== --- src/test/org/apache/hcatalog/mapreduce/HCatBaseTest.java (revision 1390047) +++ src/test/org/apache/hcatalog/mapreduce/HCatBaseTest.java (working copy) @@ -39,8 +39,8 @@ */ public class HCatBaseTest { protected static final Logger LOG = LoggerFactory.getLogger(HCatBaseTest.class); - protected static final String TEST_DATA_DIR = System.getProperty("user.dir") + - "/build/test/data/" + HCatBaseTest.class.getCanonicalName(); + protected static final String TEST_DATA_DIR = + "/tmp/build/test/data/" + HCatBaseTest.class.getCanonicalName(); protected static final String TEST_WAREHOUSE_DIR = TEST_DATA_DIR + "/warehouse"; protected HiveConf hiveConf = null; Index: src/test/org/apache/hcatalog/mapreduce/TestSequenceFileReadWrite.java =================================================================== --- src/test/org/apache/hcatalog/mapreduce/TestSequenceFileReadWrite.java (revision 1390047) +++ src/test/org/apache/hcatalog/mapreduce/TestSequenceFileReadWrite.java (working copy) @@ -53,8 +53,8 @@ import org.junit.Test; public class TestSequenceFileReadWrite extends TestCase { - private static final String TEST_DATA_DIR = System.getProperty("user.dir") + - "/build/test/data/" + TestSequenceFileReadWrite.class.getCanonicalName(); + private static final String TEST_DATA_DIR = + "/tmp/build/test/data/" + TestSequenceFileReadWrite.class.getCanonicalName(); private static final String TEST_WAREHOUSE_DIR = TEST_DATA_DIR + "/warehouse"; private static final String INPUT_FILE_NAME = TEST_DATA_DIR + "/input.data"; Index: src/test/org/apache/hcatalog/mapreduce/TestHCatMultiOutputFormat.java =================================================================== --- src/test/org/apache/hcatalog/mapreduce/TestHCatMultiOutputFormat.java (revision 1390047) +++ src/test/org/apache/hcatalog/mapreduce/TestHCatMultiOutputFormat.java (working copy) @@ -99,7 +99,7 @@ @Override public void run() { try { - String warehouseConf = HiveConf.ConfVars.METASTOREWAREHOUSE.varname + "=" + String warehouseConf = "hive.metastore.warehouse.dir" + "=" + warehousedir.toString(); HiveMetaStore.main(new String[]{"-v", "-p", msPort, "--hiveconf", warehouseConf}); } catch (Throwable t) { @@ -191,15 +191,15 @@ hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + msPort); hiveConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTRETRIES, 3); - hiveConf.set(HiveConf.ConfVars.SEMANTIC_ANALYZER_HOOK.varname, + hiveConf.set("hive.semantic.analyzer.hook", HCatSemanticAnalyzer.class.getName()); - hiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, ""); - hiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, ""); - hiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false"); - System.setProperty(HiveConf.ConfVars.PREEXECHOOKS.varname, " "); - System.setProperty(HiveConf.ConfVars.POSTEXECHOOKS.varname, " "); + hiveConf.set("hive.exec.pre.hooks", ""); + hiveConf.set("hive.exec.post.hooks", ""); + hiveConf.set("hive.support.concurrency", "false"); + System.setProperty("hive.exec.pre.hooks", " "); + System.setProperty("hive.exec.post.hooks", " "); - hiveConf.set(HiveConf.ConfVars.METASTOREWAREHOUSE.varname, warehousedir.toString()); + hiveConf.set("hive.metastore.warehouse.dir", warehousedir.toString()); try { hmsc = new HiveMetaStoreClient(hiveConf, null); initalizeTables(); @@ -376,7 +376,7 @@ partLocs.add(part.getLocation()); partDesc.add(Utilities.getPartitionDesc(part)); } - work = new FetchWork(partLocs, partDesc, Utilities.getTableDesc(tbl)); + work = new FetchWork(partLocs, partDesc); work.setLimit(100); } else { work = new FetchWork(tbl.getDataLocation().toString(), Utilities.getTableDesc(tbl)); Index: src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java =================================================================== --- src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java (revision 1390047) +++ src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java (working copy) @@ -132,7 +132,10 @@ String command = String.format(format, args); CommandProcessorResponse resp = hcatDriver.run(command); Assert.assertNotSame(resp.getErrorMessage(), 0, resp.getResponseCode()); - Assert.assertTrue((resp.getResponseCode() == 40000) || (resp.getResponseCode() == 403)); + // Hive 0.10 changes the return code, here we include 12 as well to make + // HCat test pass both in 0.10 and 0.9 + Assert.assertTrue((resp.getResponseCode() == 40000) || (resp.getResponseCode() == 403) + || (resp.getResponseCode() == 12)); if (resp.getErrorMessage() != null) { Assert.assertTrue(resp.getErrorMessage().contains("org.apache.hadoop.security.AccessControlException")); } Index: src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java =================================================================== --- src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java (revision 1390047) +++ src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java (working copy) @@ -117,7 +117,7 @@ @Test public void testUsNonExistentDB() throws CommandNeedRetryException { CommandProcessorResponse resp = hcatDriver.run("use no_such_db"); - assertEquals(1, resp.getResponseCode()); + assertEquals(9, resp.getResponseCode()); } @Test @@ -281,8 +281,8 @@ hcatDriver.run("drop table junit_sem_analysis"); query = "create table junit_sem_analysis (a int) as select * from tbl2"; CommandProcessorResponse response = hcatDriver.run(query); - assertEquals(40000, response.getResponseCode()); - assertTrue(response.getErrorMessage().contains("FAILED: SemanticException Operation not supported. Create table as Select is not a valid operation.")); + assertEquals(10, response.getResponseCode()); + assertTrue(response.getErrorMessage().contains("Operation not supported. Create table as Select is not a valid operation.")); hcatDriver.run("drop table junit_sem_analysis"); } @@ -318,10 +318,8 @@ query = "create table junit_sem_analysis (a int) partitioned by (b int) stored as RCFILE"; CommandProcessorResponse response = hcatDriver.run(query); - assertEquals(40000, response.getResponseCode()); - assertEquals("FAILED: SemanticException Operation not supported. HCatalog only supports partition columns of type string. For column: b Found type: int", - response.getErrorMessage()); - + assertEquals(10, response.getResponseCode()); + assertTrue(response.getErrorMessage().contains("Operation not supported. HCatalog only supports partition columns of type string. For column: b Found type: int")); } @Test Index: src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java =================================================================== --- src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java (revision 1390047) +++ src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java (working copy) @@ -483,7 +483,10 @@ throws IOException { fs.setPermission(dir, permission); try { - fs.setOwner(dir, null, group); + if (!System.getProperty("os.name").toUpperCase().startsWith("WINDOWS") + || !group.endsWith("\\None")) { + fs.setOwner(dir, null, group); + } } catch (AccessControlException ace) { LOG.warn("Error changing group of " + dir, ace); } @@ -494,7 +497,10 @@ } else { fs.setPermission(fileStatus.getPath(), permission); try { - fs.setOwner(dir, null, group); + if (!System.getProperty("os.name").toUpperCase().startsWith("WINDOWS") + || !group.endsWith("\\None")) { + fs.setOwner(dir, null, group); + } } catch (AccessControlException ace) { LOG.warn("Error changing group of " + dir, ace); } Index: src/java/org/apache/hcatalog/cli/HCatDriver.java =================================================================== --- src/java/org/apache/hcatalog/cli/HCatDriver.java (revision 1390047) +++ src/java/org/apache/hcatalog/cli/HCatDriver.java (working copy) @@ -94,7 +94,8 @@ if (null != perms) { fs.setPermission(tblPath, perms); } - if (null != grp) { + if(null != grp && (!System.getProperty("os.name").toUpperCase().startsWith("WINDOWS") + || !grp.endsWith("\\None"))){ fs.setOwner(tblPath, null, grp); } return 0; @@ -123,7 +124,8 @@ if (perms != null) { fs.setPermission(dbPath, perms); } - if (null != grp) { + if(null != grp && (!System.getProperty("os.name").toUpperCase().startsWith("WINDOWS") + || !grp.endsWith("\\None"))){ fs.setOwner(dbPath, null, grp); } return 0;