在映射数据流中创建新分支Creating a new branch in mapping data flow

适用于: Azure 数据工厂 Azure Synapse Analytics

添加新分支,对同一数据流执行多组操作和转换。Add a new branch to do multiple sets of operations and transformations against the same data stream. 如果要为多个接收器使用相同的源,或将自联接数据一起使用,则添加新分支会很有用。Adding a new branch is useful when you want to use the same source to for multiple sinks or for self-joining data together.

与其他转换类似,可以从转换列表中添加新的分支。A new branch can be added from the transformation list similar to other transformations. 仅在你尝试分支的转换之后存在现有转换时,“新建分支”才可作为操作使用。New Branch will only be available as an action when there's an existing transformation following the transformation you're attempting to branch.

屏幕截图显示“多个输入/输出”菜单中的“新建分支”选项。Screenshot shows the New branch option in the Multiple inputs / outputs menu.

在下面的示例中,数据流正在读取出租车行程数据。In the below example, the data flow is reading taxi trip data. 需要按日期和供应商汇总的输出。Output aggregated by both day and vendor is required. 可以添加一个新的分支,而不是创建从同一源读取的两个单独的数据流。Instead of creating two separate data flows that read from the same source, a new branch can be added. 这样,两种聚合都可以作为同一数据流的一部分执行。This way both aggregations can be executed as part of the same data flow.

屏幕截图显示来自源的两个分支的数据流。Screenshot shows the data flow with two branches from the source.

备注

单击加号 (+) 将转换添加到图形时,如果存在后续转换块,将只会看到“新建分支”选项。When clicking the plus (+) to add transformations to your graph, you will only see the New Branch option when there are subsequent transformation blocks. 这是因为“新建分支”会创建对现有流的引用,并需要进一步的上游处理才能继续操作。This is because New Branch creates a reference to the existing stream and requires further upstream processing to operate on. 如果看不到“新建分支”选项,请首先添加派生列或其他转换,然后返回到上一个块,就会看到“新建分支”选项。If you do not see the New Branch option, add a Derived Column or other transformation first, then return to the previous block and you will see New Branch as an option.

后续步骤Next steps

建立分支后,建议使用数据流转换After branching, you may want to use the data flow transformations