Hello @AnuradhaV,
Thanks for raising questions in community. We usually don't suggest to put files with special characters in file name to hdfs. If you have to do this you should replace the special characters with URL encoding.
For example, below characters should be encoded as:
# encoded as %23
? encoded as %3F
= encoded as %3D
; encoded as %3B
A full list of URL encoding characters:
https://www.degraeve.com/reference/urlencoding.php
To help you test it out, I created these files in my local and then put them to hdfs:
# ls
900-0314-Slide#2.vsi abc.html?C=S;O=A
# hdfs dfs -put 900-0314-Slide%232.vsi /tmp/
# hdfs dfs -put abc.html%3FC%3DS%3BO%3DA /tmp/
# hdfs dfs -ls /tmp
Found 2 items
-rw-r--r-- 3 hdfs supergroup 0 2021-09-03 07:07 /tmp/900-0314-Slide#2.vsi
-rw-r--r-- 3 hdfs supergroup 0 2021-09-03 07:15 /tmp/abc.html?C=S;O=A
Thanks,
Will
If the answer helps, please accept as solution and click thumbs up.