Azure数据工厂的现有转换

时间:2020-08-17 16:18:18

标签: azure-data-factory-2

比较两个表后再使用Case函数,有没有办法?

我正在尝试根据Exists转换创建一个新的专栏。在sql中,我是这样的:

(isnull (select 'YES' from sales where salesperson = t1.salesperson group by salesperson), 'NO')) AS registeredSales

T1 is personal.

还是应该将表包含在联接流中,然后使用case()函数比较两列?

如果还有另一种方法可以比较这两个流,我将很高兴听到。

谢谢。

1 个答案:

答案 0 :(得分:2)

也可以比较数据湖中的平面文件。我们可以在数据流中使用derived column来整理新列。

  1. 我创建了一个数据流演示,其中包含两个源: CustomerSource (customer.csv存储在datalake2中)和 SalesSource (sales.csv存储在datalake2中,并且仅包含一列)如下

enter image description here

  1. 然后,我将两个来源与 CustomerId
  2. 列合并

enter image description here

  1. 然后,我使用 Select 活动为 SalesSource
  2. 中的 CustomerId 提供别名

enter image description here

  1. DerivedColumn 中,选择 Add列,然后输入表达式iifNull(SalesCustomerID, 'NO', 'YES')来生成名为“ registeredSales”的新列,如下所示: enter image description here

  2. 结果的最后一列显示:

enter image description here