简体   繁体   English

访问元数据会导致 Azure 数据工厂的嵌套管道

[英]Accessing metadata results in a nested pipeline for Azure Data Factory

I have a pipeline built that reads metadata from a blob container subfolder raw/subfolder.我构建了一个管道,用于从 blob 容器子文件夹 raw/subfolder 读取元数据。 I then execute a foreach loop with another get metadata task to get data for each subfolder, it returns the following type of data.然后我使用另一个获取元数据任务执行 foreach 循环以获取每个子文件夹的数据,它返回以下类型的数据。 /raw/subfolder1/folder1, /raw/subfolder2/folder1, /raw/subfolder2/folder1 and so on. /raw/subfolder1/folder1、/raw/subfolder2/folder1、/raw/subfolder2/folder1 等等。 I need another foreach loop to access the files inside of each folder.我需要另一个 foreach 循环来访问每个文件夹内的文件。 The problem is that you cannot run a foreach loop inside of another foreach loop so I cannot iterate further on the files.问题是您不能在另一个 foreach 循环内运行一个 foreach 循环,因此我无法进一步迭代文件。

I have an execute datapipline that calls the above pipeline and then uses a foreach.我有一个调用上述管道然后使用 foreach 的执行数据管道。 My issue with this is that I'm not finding a way to pass the item().name from the above iteration to my new pipeline.我的问题是我没有找到将 item().name 从上述迭代传递到我的新管道的方法。 It doesn't appear you can pass in objects form the previous pipeline?您似乎无法从先前的管道传入对象? How would I be able to accomplish this nested foreach metat data gathering so I can iterate further on my files?我如何才能完成这种嵌套的 foreach 元数据收集,以便我可以进一步迭代我的文件?

Have you tried using parameters?您是否尝试过使用参数? Here is how it would look like:这是它的样子:

  1. In your parent pipeline, click on the "Execute Pipeline" activity which triggers the inner (your new pipeline) go to Settings and specify item name as a parameter "name".在您的父管道中,单击触发内部(您的新管道)go 到设置的“执行管道”活动,并将项目名称指定为参数“名称”。 在此处输入图像描述
  2. In your inner pipeline, click anywhere on empty space and add new parameter "name".在您的内部管道中,单击空白处的任意位置并添加新参数“名称”。 在此处输入图像描述
  3. Now you can refer to that parameter like this: pipeline().parameters.name现在您可以像这样引用该参数:pipeline().parameters.name

Using Parameters works in this scenario as @Andrii mentioned.如@Andrii 所述,在这种情况下使用参数有效。 For more on passing parameters between activities refer to this link.有关在活动之间传递参数的更多信息,请参阅此链接。 https://azure.microsoft.com/en-in/resources/azure-data-factory-passing-parameters/ https://azure.microsoft.com/en-in/resources/azure-data-factory-passing-parameters/

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

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