[英]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?你以前遇到过这种情况吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.