You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by pr...@apache.org on 2010/01/08 00:06:27 UTC
svn commit: r897045 -
/hadoop/pig/branches/load-store-redesign/src/org/apache/pig/LoadFunc.java
Author: pradeepkth
Date: Thu Jan 7 23:06:26 2010
New Revision: 897045
URL: http://svn.apache.org/viewvc?rev=897045&view=rev
Log:
minor fix in getAbsolutePath() in LoadFunc to handle the case where the location is already an absolute path with valid authority in the url
Modified:
hadoop/pig/branches/load-store-redesign/src/org/apache/pig/LoadFunc.java
Modified: hadoop/pig/branches/load-store-redesign/src/org/apache/pig/LoadFunc.java
URL: http://svn.apache.org/viewvc/hadoop/pig/branches/load-store-redesign/src/org/apache/pig/LoadFunc.java?rev=897045&r1=897044&r2=897045&view=diff
==============================================================================
--- hadoop/pig/branches/load-store-redesign/src/org/apache/pig/LoadFunc.java (original)
+++ hadoop/pig/branches/load-store-redesign/src/org/apache/pig/LoadFunc.java Thu Jan 7 23:06:26 2010
@@ -242,11 +242,16 @@
throw new FrontendException("Incompatible file URI scheme: "
+ scheme + " : " + fsScheme);
}
-
String path = uri.getPath();
- fname = (p.isAbsolute()) ?
- new Path(rootDir, path).toString() :
- new Path(curDir, path).toString();
+ // if the supplied location has an authority and is absolute, just
+ // use it
+ if(uri.getAuthority() != null && p.isAbsolute()) {
+ fname = p.toString();
+ } else {
+ fname = (p.isAbsolute()) ?
+ new Path(rootDir, path).toString() :
+ new Path(curDir, path).toString();
+ }
fname = fname.replaceFirst("^file:/([^/])", "file:///$1");
pathStrings.add(fname);
}