incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avand...@apache.org
Subject svn commit: r1432237 - in /incubator/hcatalog/trunk: CHANGES.txt core/src/main/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java
Date Fri, 11 Jan 2013 19:14:32 GMT
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());



Mime
View raw message