数据工厂子项修改或创建日期

2024-03-26

我有一个数据工厂 V2 管道,由“获取元数据”和“forEach”活动组成,用于读取文件共享(本地)上的文件列表并将其记录在数据库表中。目前,我只能读取文件名,但还想检索每个文件的修改日期和/或创建日期属性。有什么帮助吗?

谢谢


According to the MS documentation https://learn.microsoft.com/azure/data-factory/control-flow-get-metadata-activity. We can see File system and SFTP both support the lastModified property. But we only can get the lastModified of one file or folder at a time. enter image description here

I'm using File system to do the test. The process is basically the same as the previous post https://stackoverflow.com/questions/65161230/azure-data-factory-v2-copy-activity-save-list-of-all-copied-files, we need to add a GetMetaData activity to the ForEach activity. This is my local files. enter image description here

  1. 首先,我创建了一个用于记录的表。
create table Copy_Logs (
    Copy_File_Name varchar(max),
    Last_modified datetime
)
  1. In ADF, I'm using Child Items at Get Metadata1 activity to get the file list of the folder. enter image description here

  2. Then add dynamic content @activity('Get Metadata1').output.childItems at ForEach1 activity. enter image description here

  3. Inside the ForEach1 activity, using Last modified at Get Metadata2 activity. enter image description here

In the dataset of Get Metadata2 activity, I key in @item().name as follows. enter image description here

  1. Using CopyFiles_To_Azure activity to copy local files to the Azure Data Lake Storage V2. enter image description here I key in @item().name at the source dataset of CopyFiles_To_Azure activity. enter image description here

  2. At Create_Logs activity, I'm using the following sql to get the info we need. enter image description here

select '@{item().name}' as Copy_File_Name, '@{activity('Get Metadata2').output.lastModified}' as Last_modified
  1. In the end, sink to the sql table we created previously. The result is as follows. enter image description here
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

数据工厂子项修改或创建日期 的相关文章

随机推荐

  • Dart - 试图理解“工厂”构造函数的价值

    如果我理解正确的话 A factory constructor affords an abstract class to be instantiated by another class despite being abstract 例如
  • 仅调用一个 Paint 事件

    我的问题是我有 8 个图片框 但一次只有其中一个调用其绘制方法 我的代码有点太大 所以我尝试尽可能地将其范围缩小到受影响的部分 我最好的猜测是 这并不是我的代码中的错误 而是对绘制事件如何工作的误解 我有一个继承自 PictureBox 的
  • Spark SQL - 从 sql 函数生成数组的数组

    我想创建一个数组的数组 这是我的数据表 A case class for our sample table case class Testing name String age Int salary Int Create an RDD wi
  • 重命名命令中的下划线(Perl 和 Unix shell)

    我正在尝试替换所有 下划线字符为 所有文件名中的连字符 mat在一个文件夹内 我输入不同版本但未成功 rename f w mat 有人可以向我解释一下出了什么问题吗 如果您正在使用基于 Perl 的rename http socialte
  • Export-CSV 仅获取“长度”

    当我尝试导出到 CSV 列表时 我只得到 长度 的所有数字 Count属性 直到到达分割点 然后将 CSV 数组分割到一个新文件 并使用从此时开始使用的新名称 可能是什么问题 RootFolder Get Content c DRIVERS
  • `agrep(...,fixed=F)` 的困难

    In agrep grep模糊匹配 它提到我可以设置参数fixed FALSE让我的模式被解释为正则表达式 但是 我无法让它工作 agrep asdf fdsa asdf fixed F integer 0 以上should匹配正则表达式
  • 使用 Codeigniter 将复选框值传递到 mysql 数据库

    我正在使用 CodeIgniter 和 mySQL 构建复选框表单 该表格包含 4 个选项 每个选项只有一个复选框 用户可以选择选项的任意组合 我想做以下事情 1 对于每个复选框 使用值 1 如果未选中 或 2 如果选中 并将这些值传递到数
  • 第一个项目需要注意什么

    我想创建一个程序 它将接受用户输入并创建一个 使用输入的日历 示例 约翰 康纳 2010 年 1 月 3 日生日 此信息还可按明显的顺序排序 姓氏 名字 日期 其他 它将能够将此信息打印为列表或日历 必须有例外 例如 1 3 10 放在 2
  • JTable 编辑/取消编辑代码不适用于重新排列的 JTable 列

    我使用以下代码对 JTable 列进行编辑 取消编辑 但是当用户重新排列列时 以下代码不起作用 SSCCE的代码如下 import javax swing JTable import javax swing table DefaultTab
  • System.Web.Routing.RouteCollection.GetRouteData 中的异常

    我在 iis7 上运行的 ASP NET MVC 代码中随机出现两个异常 Exception type InvalidOperationException Exception message Collection was modified
  • jquery Accordion - 从外部链接单击返回时记住活动区域

    我的链接位于页面上的 jquery 手风琴内部 当访问者单击其中一个链接然后单击后退按钮返回我的页面时 我希望打开包含该链接的手风琴 我的假设是我应该使用 navigation true 设置并将主题标签添加到不同的手风琴 但这对我不起作用
  • Instagram 基本显示 API 错误 - 无效范围:['basic'] 或无效的 redirect_uri

    我正在使用 Magento 2 4 1 安装了社交登录扩展 并在登录 Instagram 时出现以下错误 我正在使用混合身份验证库进行登录 error type OAuthException 代码 400 error message 无效
  • Linux Xwindow 转发上的 Visual Studio Code

    我的配置如下 OS DISTRIB ID Ubuntu DISTRIB RELEASE 14 04 DISTRIB CODENAME trusty DISTRIB DESCRIPTION Ubuntu 14 04 4 LTS NAME Ub
  • 更新 my.cnf 中的变量

    I set lower case table names 2在 my cnf 文件中 设置变量后 我重新启动了 mysql 服务器 但当我使用时 该值仍然是 0SHOW VARIABLES 我正在使用 MySQL 5 5 任何想法还需要做什
  • HTML:阻止子元素继承父元素的 [title] 属性

    问题是 当我为 wrapper 元素声明标题属性时 当光标落入 content 元素内时 也会显示工具提示 如何防止这种情况 继承 发生 div title example div div div 我只想显示工具提示between cont
  • 如何使用 gradle 任务解析 .json 文件并从中获取 json 数据?

    有没有一种方法可以在 gradle 任务的帮助下解析 xyz json 文件并获取其中的所有单独的 json 数据 例如 我想解析存储在我的资产文件夹中的 xyz json 文件中的数据并获取其中的所有值 例如 获取 类型 的值 type
  • 在CSS中创建凹角[重复]

    这个问题在这里已经有答案了 是否可以在CSS中创建这样的凹角 如果是 你会怎么做 莉亚 维鲁有一个如何执行此操作的描述 http lea verou me 2011 03 beveled corners negative border ra
  • 使用 jQuery getJSON 时 JSON Feed 返回 null

    http portlandonline com shared cfm json cfm c 27321 http portlandonline com shared cfm json cfm c 27321 它返回 null 我真的无权接触
  • 匿名委托中捕获的私有字段

    class A public event EventHandler AEvent class B private A foo private int bar public void AttachToAEvent foo AEvent del
  • 数据工厂子项修改或创建日期

    我有一个数据工厂 V2 管道 由 获取元数据 和 forEach 活动组成 用于读取文件共享 本地 上的文件列表并将其记录在数据库表中 目前 我只能读取文件名 但还想检索每个文件的修改日期和 或创建日期属性 有什么帮助吗 谢谢 Accord