azure - 在 Azure 数据工厂 DataFlow 中根据文件名创建动态文件夹

标签 azure data-science azure-data-factory

我正在开发一个 Azure 数据工厂数据流管道,其中有一个接收器事件。接收器中的一列包含格式为“2023-07-19_diane_12345.csv”的文件名信息。我想使用一种模式从文件名中提取特定数据,并根据以下模式 yyyy/mm/dd 创建文件夹。

我尝试在表达式中使用 substring 和 lastIndexOf 函数,但它没有按预期工作。 下面的参数包含文件名

enter image description here

在 SINK 事件中,我尝试使用表达式生成器来完成该工作,但它说未找到列。

enter image description here

我猜我正在构建的表达式似乎是针对 CopyActivity 而不是针对 Dataflow 的。还有其他方法可以动态执行作业并创建文件夹吗?

管道看起来像这样

enter image description here

还有接收器设置:

enter image description here

最佳答案

在派生列中添加具有以下表达式生成器的列

replace(substring(fileName ,0, 10),"-","/")

这里fileName是存储文件名的列。

enter image description here

按如下所述配置接收器设置:

  • 文件名选项: Name folder as column data
  • 列数据: <created column>

enter image description here

该文件将存储在yyyy/mm/dd中格式如下:

enter image description here

关于azure - 在 Azure 数据工厂 DataFlow 中根据文件名创建动态文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76753693/

相关文章:

Azure.Identity.CredentialUnavailableException问题

javascript - 将文件上传到 Windows Azure,仅提供文件的链接

azure - 将管道从一个 ADF 克隆到另一个 ADF

python - openpyxl 数据透视表和 pandas 数据透视表

mongodb - 在 Azure 数据工厂中创建 MongoDB 链接服务

azure - 通过 Azure 数据工厂从 ftp 站点获取 zip 和非压缩文件 - 解压缩

windows - Git Bash 错误 : Could not fork child process: Permission denied (-1)

Azure 自动化启动-AzureAutomationRunbook 错误

python - Pandas 将数据放入 df 中

python - 使用结果数据而不是分类器的 Sklearn 集成模型