5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 05:19:34 +08:00

SQOOP-373 Can only write to default file system on direct import

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1196980 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bilung Lee 2011-11-03 07:10:50 +00:00
parent 22ed175b76
commit fc656273d4
2 changed files with 3 additions and 4 deletions

View File

@ -79,8 +79,6 @@ public SplittingOutputStream(final Configuration conf, final Path destDir,
/** Initialize the OutputStream to the next file to write to.
*/
private void openNextFile() throws IOException {
FileSystem fs = FileSystem.get(conf);
StringBuffer sb = new StringBuffer();
Formatter fmt = new Formatter(sb);
fmt.format("%05d", this.fileNum++);
@ -89,6 +87,7 @@ private void openNextFile() throws IOException {
filename = filename + codec.getDefaultExtension();
}
Path destFile = new Path(destDir, filename);
FileSystem fs = destFile.getFileSystem(conf);
LOG.debug("Opening next output file: " + destFile);
if (fs.exists(destFile)) {
Path canonicalDest = destFile.makeQualified(fs);

View File

@ -77,10 +77,10 @@ public static void setFilePermissions(File file, String modstr)
public static SplittableBufferedWriter createHdfsSink(Configuration conf,
SqoopOptions options, ImportJobContext context) throws IOException {
FileSystem fs = FileSystem.get(conf);
Path destDir = context.getDestination();
FileSystem fs = destDir.getFileSystem(conf);
LOG.debug("Writing to filesystem: " + conf.get("fs.default.name"));
LOG.debug("Writing to filesystem: " + fs.getUri());
LOG.debug("Creating destination directory " + destDir);
fs.mkdirs(destDir);