如何在没有逻辑和没有失败的情况下停止数据工厂的管道执行?

huangapple go评论69阅读模式
英文:

Data Factory: how to stop pipeline execution without logic and without failure?

问题

我有一个简单的流程,包括:

  • 一个笔记本,在成功完成后,接着执行;
  • 一个ForEach循环。

当笔记本成功执行时,会有以下输出之一:

  1. 为ForEach循环提供的数值数组(这没有问题)。
  2. 某些条件未满足的消息(有问题的部分)。

在情况二中,会将一个字符串传递给ForEach循环,导致活动失败。这不是期望的结果,因为流程应该成功运行。

我尝试使用Switch活动来解决问题,但不能在Switch中放置一个ForEach活动。当我尝试使用If条件活动时,出现了相同的问题。

欢迎任何解决方案和变通方法。

英文:

I have a simple pipeline consisting of:

  • A notebook, when completed successfully followed by;
  • A ForEach loop.

When executed successfully, the notebook either outputs:

  1. An array of values for the ForEach loop (no issue here).
  2. A message that some conditions are not met (troublesome part).

In situation two a string is passed to the ForEach loop, which causes the activity to fail. This is not the desired result, because the pipeline should run successfully.

I have tried to solve the issue with the Switch activity, but you can not put a ForEach activity in a Switch. The same issue arises when I try to use the If Condition activity.

Any solutions and workarounds are welcome.

答案1

得分: 2

根据Microsoft文档,在Azure数据工厂(ADF)中,For-each活动不能嵌套在if活动或switch活动内部。相反,使用Execute Pipeline活动来创建嵌套管道,其中父管道具有If活动,而子管道具有for-each活动。

限制 解决方法
不能将ForEach循环嵌套在另一个ForEach循环(或Until循环)内部。 设计一个两级管道,外部管道具有外部ForEach循环,迭代内部具有嵌套循环的内部管道。

请参阅此SO线程上的NiharikaMoola-MT的答案。
在父管道中,保留笔记本活动If活动。然后在If活动的true部分内调用子管道,其中包含for-each活动

英文:

As per Microsoft Document, For-each activity cannot be nested inside if activity or switch activity in Azure Data Factory (ADF). Instead, use the Execute Pipeline activity to create nested pipelines, where the parent has If activity and the child pipeline has for-each activity.

Limitation Workaround
You can't nest a ForEach loop inside another ForEach loop (or an Until loop). Design a two-level pipeline where the outer pipeline with the outer ForEach loop iterates over an inner pipeline with the nested loop.

Refer the NiharikaMoola-MT's answer on this SO thread.
In the parent pipeline, keep Notebook activity and If activity. Then invoke the child pipeline with for-each activity inside the true section of If activity.

huangapple
  • 本文由 发表于 2023年1月6日 10:48:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/75026466.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定