简体   繁体   English

Azure 数据工厂动态文件夹路径

[英]Azure Data Factory Dynamic Folder Path

I'm trying to create a dynamic copy activity which uses a GetMededata and a filter activity within data factory to do incremental loads.我正在尝试创建一个动态复制活动,该活动使用 GetMededata 和数据工厂中的过滤活动来执行增量加载。

The file path I'm trying to copy looks like: 2022/08/01我要复制的文件路径如下:2022/08/01
It goes from year folder - month folder - to days of the month folder and each day folder containing several files:它从年文件夹 - 月文件夹 - 到月文件夹和包含多个文件的每一天文件夹:

I need get metadata and filter activity to read the file, however the output directory on the filter activity foes not have the desired path.我需要获取元数据和过滤器活动来读取文件,但是过滤器活动敌人上的 output 目录没有所需的路径。

在此处输入图像描述

The variable I've currently is set is dynamically expressed我当前设置的变量是动态表达的
@concat(variables('v_BlobSourceDirectory'), variables('v_Set_date')) @concat(变量('v_BlobSourceDirectory'),变量('v_Set_date'))

filter activity过滤活动
@activity('Get Source').output.childItems @activity('获取源').output.childItems

get metadata activity获取元数据活动
@and(equals(item().type,'Folder'),endswith(item().name,variables('v_Set_Date'))) @and(equals(item().type,'Folder'),endswith(item().name,variables('v_Set_Date')))

I have reproduced ADLSGen2 file path 2022/09/21 format added sample files.我已经复制了 ADLSGen2 文件路径 2022/09/21 格式添加的示例文件。

在此处输入图像描述

Using Metadata activity all the child items has been pulled and given has input to foreach activity.使用元数据活动,所有子项目都已被拉出,并为 foreach 活动提供了输入。

在此处输入图像描述 Added Dynamic values for month and days.添加了月份和日期的动态值。

在此处输入图像描述 Every childitem is iterated through foreach activity.每个子项都通过 foreach 活动进行迭代。

在此处输入图像描述 for each activity output is given to copy.对于每个活动 output 被给予复制。

在此处输入图像描述 在此处输入图像描述

在此处输入图像描述

**Result:**Every childitem is copied and stored in Dynamicoutput1 **结果:**每个子项都被复制并存储在 Dynamicoutput1 中

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM