You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hcatalog-commits@incubator.apache.org by av...@apache.org on 2013/01/11 19:14:32 UTC

svn commit: r1432237 - in /incubator/hcatalog/trunk: CHANGES.txt core/src/main/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java

Author: avandana
Date: Fri Jan 11 19:14:32 2013
New Revision: 1432237

URL: http://svn.apache.org/viewvc?rev=1432237&view=rev
Log:
HCAT-554 Loading data using HCatLoader() from a table on non default namenode fails.

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/core/src/main/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1432237&r1=1432236&r2=1432237&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Fri Jan 11 19:14:32 2013
@@ -29,6 +29,7 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-554 Loading data using HCatLoader() from a table on non default namenode fails. (amalakar via avandana)
 
 Release 0.5.0 - Unreleased
 

Modified: incubator/hcatalog/trunk/core/src/main/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/core/src/main/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java?rev=1432237&r1=1432236&r2=1432237&view=diff
==============================================================================
--- incubator/hcatalog/trunk/core/src/main/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java (original)
+++ incubator/hcatalog/trunk/core/src/main/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java Fri Jan 11 19:14:32 2013
@@ -316,15 +316,15 @@ public abstract class HCatBaseInputForma
         pathStrings.add(location.substring(pathStart, length));
 
         Path[] paths = StringUtils.stringToPath(pathStrings.toArray(new String[0]));
+        String separator = "";
+        StringBuilder str = new StringBuilder();
 
-        FileSystem fs = FileSystem.get(jobConf);
-        Path path = paths[0].makeQualified(fs);
-        StringBuilder str = new StringBuilder(StringUtils.escapeString(
-            path.toString()));
-        for (int i = 1; i < paths.length; i++) {
-            str.append(StringUtils.COMMA_STR);
-            path = paths[i].makeQualified(fs);
-            str.append(StringUtils.escapeString(path.toString()));
+        for (Path path : paths) {
+            FileSystem fs = path.getFileSystem(jobConf);
+            final String qualifiedPath = fs.makeQualified(path).toString();
+            str.append(separator)
+                .append(StringUtils.escapeString(qualifiedPath));
+            separator = StringUtils.COMMA_STR;
         }
 
         jobConf.set("mapred.input.dir", str.toString());