我正在尝试将一些文件上传到ADLS中的特定文件夹。以下是用于上传文件的az上传脚本。
az dls fs upload --account $adls_account --source-path $src_dir --destination-path $dest_dir --thread-count $thread_count --debug
目标文件夹已存在于ADLS中,我正在尝试向其中添加更多文件。但是在运行此脚本时,它会抛出错误:
Traceback (most recent call last):
File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/application.py", line 211, in execute
result = expanded_arg.func(params)
File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 346, in __call__
return self.handler(*args, **kwargs)
File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 545, in _execute_command
reraise(*sys.exc_info())
File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 522, in _execute_command
result = op(client, **kwargs) if client else op(**kwargs)
File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/dls/custom.py", line 174, in upload_to_adls
ADLUploader(client, destination_path, source_path, thread_count, overwrite=overwrite)
File "/mnt/resource/apps/azure-cli/lib/python2.7/site-packages/azure/datalake/store/multithread.py", line 347, in __init__
raise FileExistsError(rpath)
FileExistsError: /folder1/folder2/folder3/
正在使用
$ az --version
azure-cli (2.0.9)
有些人可以帮我解决一下这个错误吗?基本上我想在上传到ADLS时关闭覆盖功能。
谢谢,
阿琼
答案 0 :(得分:1)
返回的错误包括对“FileExistsError:/ folder1 / folder2 / folder3 /”的引用。表示该文件夹已存在。
根据command reference,由于您未使用-overwrite参数,因此如果目标已存在,则操作将失败。 我无法看到您为$ src_dir设置的值,但如果将其设置为“/ folder1 / folder2 / folder3”,则会导致错误。