我正在尝试将文件夹从本地系统移动到包含%20的hdfs。我不能更改文件夹名称,因为它是一列的值,并且这些名称是在写入文件时由带有分区列的spark创建的。我需要将它们移动到hdfs并在hive / impala表中查看它们。
例如:
HADOOP_USER_NAME=vishal hdfs dfs -copyFromLocal "/home/vishal/incoming/partition-edit/tableName/cp_sys_name=Change%20Request%20Satisfaction%20Survey/cp_evaluation_method=survey/" /data/files/vishal/managed/asmt_metric_type_orc_sep_29/cp_sys_name=Change%20Request%20Satisfaction%20Survey/cp_evaluation_method=survey
执行上述命令,但在内部将%20视为空格并抛出File not found异常。
Error while Inserting data into target: copyFromLocal: `/home/vishal/incoming/partition-edit/asmt_metric_type_orc_sep_29/cp_sys_name=Change Request Satisfaction Survey/cp_evaluation_method=survey/': No such file or directory
java.io.IOException: copyFromLocal: `/home/vishal/incoming/partition-edit/tableName/cp_sys_name=Change Request Satisfaction Survey/cp_evaluation_method=survey/':
No such file or directory
答案 0 :(得分:0)
您可以尝试将%20替换为%2520吗? 想法是用代码“%25”替换“%”,并用“ 20”替换concat