简体   繁体   English

数据工厂 - 我可以使用 CSV 中的日期字段来确定复制活动中的目标文件夹吗

[英]Data Factory - Can I use the date field in a CSV to determine the destination folder in Copy Activity

I have some CSV files that I want to copy to a specific folder in ADLS based on the date column within the file.我有一些 CSV 文件,我想根据文件中的日期列将其复制到 ADLS 中的特定文件夹。

ie CSV file has a column named "date" that reads "2022-02-23" on all rows.即 CSV 文件有一个名为“日期”的列,在所有行上都显示为“2022-02-23”。 I want to copy that file to a folder that has the corresponding year and month, such as "/curated/UK/ProjectABC/2022/02"我想将该文件复制到具有相应年份和月份的文件夹中,例如“/curated/UK/ProjectABC/2022/02”

I've got a Lookup activity that's pointing to the source CSV file and populating a Set Variable activity with the month using this dynamic content - @substring(string(activity('Lookup1').output.firstrow.date),5,2)我有一个指向源 CSV 文件的查找活动,并使用此动态内容填充带有月份的设置变量活动 - @substring(string(activity('Lookup1').output.firstrow.date),5,2)

Would this be the right approach, to use a variable?这是使用变量的正确方法吗?

I cant use variables in the Directory portion of the Sink Dataset, as far as I know.据我所知,我不能在接收器数据集的目录部分使用变量。

Have you come across this situation before?你以前遇到过这种情况吗?

Sounds like you're on the right path.听起来你走在正确的道路上。 You can use absolutely use Dataset parameters:您可以绝对使用 Dataset 参数:

在此处输入图像描述

在此处输入图像描述

Then populate them in your pipeline using a variable (or parameter, or expression):然后使用变量(或参数或表达式)将它们填充到您的管道中:

在此处输入图像描述

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

相关问题 复制 Azure 数据工厂中的替代活动 - copy activity alternative in Azure Data Factory 数据工厂 - 复制活动 - Big XML 的设置 - Data Factory - Copy Activity - Settings for Big XML 如何使用数据工厂的删除活动删除文件夹? - How to delete folder with Delete Activity of Data Factory? Azure 数据工厂管道 - 将单值源查询 output 存储为变量,然后在复制数据活动中使用 - Azure Data Factory Pipeline - Store single-value source query output as a variable to then use in Copy Data activity 如何在 Azure 数据工厂的复制活动中捕获 output 值 - How to capture an output value in Copy Activity in Azure Data Factory Azure 数据工厂 (V2) 复制活动 - 缺少高级编辑器 - Azure Data Factory (V2) Copy Activity - advanced editor missing 复制活动中的正则表达式附加列 Azure 数据工厂 - Regex Additional Column in Copy Activity Azure Data Factory 如何在 json 中为 azure 数据工厂 (adf) 中的复制活动添加默认日期,同时在 SQL 源和接收器之间动态映射列 - How to Add default date in json for copy activity in azure data factory(adf) while dynamic mapping of columns between SQL source and sink 使用 Azure 数据工厂复制活动更新 Cosmos 项目 TTL - Upsert Cosmos item TTL using Azure Data Factory Copy Activity 如何在 Azure 数据工厂的复制活动中强制映射 - How to force mapping in copy activity of Azure Data Factory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM