Support Questions

Find answers, ask questions, and share your expertise

Error in PutHDFS while adding Time to file

avatar
Rising Star

I am using HDP 2.5. I try to add time for file which is locate in HDFS file. For that I use GetHDFS->UpdateAttribute->PutHDFS.

First I get file from HDFS through GetHDFS processor and then I change format of file in UpdateAttribute by adding property "

${filename}.${now():format("yyyy-MM-dd-HH:mm:ss.SSS'z'")}". Finally I try to put file in HDFS that time I got issue "

Failed to write to HDFS due to java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: .test.csv.2017-10-03:03:19.814z: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: .test.csv.2017-10-03:03:19.814z"
.

UpdateAttribute


39655-screenshot-from-2017-10-03-14-37-53.png

PutHDFS

39656-screenshot-from-2017-10-03-14-38-20.png

1 ACCEPTED SOLUTION

avatar
Master Guru

Hi @Narasimma varman,

if we are creating files or directories having {/,:} characters then HDFS wont allow to do that but in local we can use colon.

You can refer to below similar kind of issue.

https://community.hortonworks.com/questions/139512/create-hdfs-folder-having-namecreate-hdfs-folder-...

To resolve your issue:-

Replace all colons with some other character and try to run again.

${filename}.${now():format("yyyy-MM-dd-HH_mm_ss.SSS'z'")}"

(or)

${filename}.${now():format("yyyy-MM-dd-HHmmss.SSS'z'")}"

View solution in original post

2 REPLIES 2

avatar
Master Guru

Hi @Narasimma varman,

if we are creating files or directories having {/,:} characters then HDFS wont allow to do that but in local we can use colon.

You can refer to below similar kind of issue.

https://community.hortonworks.com/questions/139512/create-hdfs-folder-having-namecreate-hdfs-folder-...

To resolve your issue:-

Replace all colons with some other character and try to run again.

${filename}.${now():format("yyyy-MM-dd-HH_mm_ss.SSS'z'")}"

(or)

${filename}.${now():format("yyyy-MM-dd-HHmmss.SSS'z'")}"

avatar
Rising Star

Thanks Shu