Hi All,

Recently I faced a problem in HDFS producer with files which have special 
characters in the name. Apparently,when we create hadoop file system in 
HdfsInfo.java and pass the hdfsPath(hdfs://ip:port/filename,file name is 
abc}123.txt) it is unable to create the URI and it throws some exception for 
"}" in the URI.

I was able to fix this by encoding my path in UTF-8 (I used 
java.net.URLEncoder).

But now hadoop file system cannot be initialzed since URI scheme was not 
found(which I think is because URLEncoder encoded the path and URI.getScheme() 
failed or returned null).

Now,only solution I can think of is by only encoding the file name,keeping the 
rest of the path as is. For example :
hdfs://ip:port/abc%7D123.txt

Does anyone else faced a similar issue?  Is it a bug in HDFS for files with 
special characters? Any better solution for this?

Thanks!

Chirag

Reply via email to