DelimitedText (csv) 数据集自动将文件路径编码为 urlencoding 格式,连续的复制活动无法找到 blob

问题描述 投票:0回答:1

我有一个数据工厂,它在 foreach 循环内具有数据流活动和连续复制活动。数据流将文件夹路径和文件名从 bob 存储中的源容器中提取到一起,并在传递到 foreach 循环时创建文件夹路径和文件名的 urlencoding。例如 x/y/z/sample doc.pdf 变为 x/y/z/sample%20doc.pdf m/n/p/sample[1].pdf 变为 m/n/p/sample%5B1%5D.pdf

由于此复制活动会引发异常所需的 blob 丢失。如果我手动删除编码,它可以找到斑点。请建议这个问题的解决方案是什么?

我尝试将数据集编码从默认 UTF 8 更改为其他编码,但没有帮助。

azure-data-factory
1个回答
0
投票

您可以使用

decodeUriComponent(<input_string>)
找回原始文件路径。

为源数据集和接收器数据集的文件名创建数据集参数,并为 For-Each 内的复制活动中的参数提供以下表达式。

Source filepath - @decodeUriComponent(item().filepath)
Sink file name - @decodeUriComponent(item().targetpath)

作为示例,我使用设置变量活动来展示这些转换。

enter image description here

结果:

源文件路径:

enter image description here

目标文件名:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.