[ 
https://issues.apache.org/jira/browse/HCATALOG-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465196#comment-13465196
 ] 

Travis Crawford commented on HCATALOG-512:
------------------------------------------

A few comments:

* What's the error for checkstyle when running on Windows? Its curious that 
doesn't run.

* This looks problematic because it hard-codes the test output directory. This 
can cause issues on shared machines, when multiple users need to write to the 
current directly. What's wrong with user.dir? Its the current directory, and 
creates data underneath the build dir? Ideally builds would never create data 
outside the build dir, which is what "clean" cleans up, and multiple people can 
build on the same machine.

{code:title=src/test/org/apache/hcatalog/mapreduce/HCatBaseTest.java}
-    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();
{code}

What's the reason for changing these back to strings instead of referencing the 
constants? My guess is there were converted to constants in hive 0.10.0?

If we really need to do this, how about adding them to HCatConstants so we can 
find them later when requiring a minimum hive 0.10.0 version. Using the strings 
directly makes understanding who uses them more difficult.

{code:title=src/test/org/apache/hcatalog/mapreduce/TestHCatMultiOutputFormat.java}
-        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());
{code}


Here we see some platform-specific stuff going on. Let's start a util class for 
these sorts of things. Already here we see this {{startsWith("WINDOWS")}} stuff 
four times. We can enforce consistency & simplify things with something like 
{{PlatformUtil.isWindows()}}

{code:title=src/java/org/apache/hcatalog/mapreduce/FileOutputCommitterContainer.java}
-            fs.setOwner(dir, null, group);
+               if 
(!System.getProperty("os.name").toUpperCase().startsWith("WINDOWS")
+                    || !group.endsWith("\\None")) {
+                fs.setOwner(dir, null, group);
+               }
{code}
                
> Fix HCat unit test on Windows
> -----------------------------
>
>                 Key: HCATALOG-512
>                 URL: https://issues.apache.org/jira/browse/HCATALOG-512
>             Project: HCatalog
>          Issue Type: Sub-task
>    Affects Versions: 0.5
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>             Fix For: 0.5
>
>         Attachments: HCATALOG-512-1.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to