incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avand...@apache.org
Subject svn commit: r1421577 - in /incubator/hcatalog/branches/branch-0.4: CHANGES.txt src/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java
Date Thu, 13 Dec 2012 22:20:07 GMT
Author: avandana
Date: Thu Dec 13 22:20:05 2012
New Revision: 1421577

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

Modified:
    incubator/hcatalog/branches/branch-0.4/CHANGES.txt
    incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java

Modified: incubator/hcatalog/branches/branch-0.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/CHANGES.txt?rev=1421577&r1=1421576&r2=1421577&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/CHANGES.txt (original)
+++ incubator/hcatalog/branches/branch-0.4/CHANGES.txt Thu Dec 13 22:20:05 2012
@@ -71,6 +71,8 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-554 Loading data using HCatLoader() from a table on non default namenode fails.(amalakar
via avandana)
+
   HCAT-566 HCatTable doesn't report partition columns correctly. (mithun via traviscrawford)
 
   HCAT-562 HCatClient should allow for a table's message-topic-name to be queried for. (mithunr
via avandana)

Modified: incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java?rev=1421577&r1=1421576&r2=1421577&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java
(original)
+++ incubator/hcatalog/branches/branch-0.4/src/java/org/apache/hcatalog/mapreduce/HCatBaseInputFormat.java
Thu Dec 13 22:20:05 2012
@@ -48,7 +48,7 @@ import org.apache.hcatalog.data.schema.H
 
 public abstract class HCatBaseInputFormat 
   extends InputFormat<WritableComparable, HCatRecord> {
-  
+
   /**
    * get the schema for the HCatRecord data returned by HCatInputFormat.
    * 
@@ -300,15 +300,14 @@ public abstract class HCatBaseInputForma
     pathStrings.add(location.substring(pathStart, length));
 
     Path[] paths = StringUtils.stringToPath(pathStrings.toArray(new String[0]));
-
-    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()));
+    String separator = "";
+    StringBuilder str = new StringBuilder(); 
+    for (Path path : paths) {
+      FileSystem fs = path.getFileSystem(jobConf);
+      final String qualifiedPath = path.makeQualified(fs).toString();
+      str.append(separator)
+              .append(StringUtils.escapeString(qualifiedPath));
+      separator = StringUtils.COMMA_STR;
     }
 
     jobConf.set("mapred.input.dir", str.toString());



Mime
View raw message