带有空格的Hadoop目录 [英] Hadoop Directory with Spaces

查看:230
本文介绍了带有空格的Hadoop目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



eg



<$ p

我在遇到问题时提供了一个包含空格的Hadoop目录。 $ p $ inputDir = / abc / xyz /文件夹名称/ abc.txt

Hadoop以某种方式不知道文件夹名称是包含单词之间空格的文件夹的名称。



在执行此操作时出现以下错误

  java.io.FileNotFoundException:文件不存在:/ abc / xyz /文件夹

另外,我尝试使用URL编码提供。

  java.io.FileNotFoundException:文件不存在:/abc/xyz/folder%20name/abc.txt 

但是仍然会抛出同样的错误。

任何人都知道这个解决方法?



任何帮助表示赞赏。

解决方案

Hadoop不支持输入目录路径中的空格



用目录路径中的 _ 首选分隔符替换空格

I'm running into a problem while providing Hadoop a directory that contains spaces.

e.g

inputDir = /abc/xyz/folder name/abc.txt

Hadoop somehow doesn't know about the "folder name" being the name of the folder with spaces between words.

I get the below error while doing that

java.io.FileNotFoundException: File does not exist: /abc/xyz/folder

Also, I tried providing with URL encoded.

java.io.FileNotFoundException: File does not exist: /abc/xyz/folder%20name/abc.txt

But still throws me the same error.

Does anybody know the workaround for this ?

Any help is appreciated.

解决方案

Hadoop does not support empty spaces in input directory paths.

Replace space with _ or your preferred separator character in your directory paths.

这篇关于带有空格的Hadoop目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆