【发布时间】:2021-02-19 11:26:56
【问题描述】:
如何使用 Azure 数据工厂在目标表的更新接收器操作中添加筛选器。
基本上我正在尝试实现以下查询,并且我需要在目标接收器中使用过滤器 end_date = '9999-12-31。
update testdb.test_scd2
set end_date = SourceStream.end_date
where cust_id = SourceStream.cust_id
and end_date = '9999-12-31
' ADF 脚本 - 根据 Mark 的评论更新。但它正在更新目标表中的所有数据。只需要更新一行 end_date - '9999-12-31'
source(output(
cust_id as string,
end_date_new as date
),
allowSchemaDrift: true,
validateSchema: false,
ignoreNoFilesFound: false,
wildcardPaths:['walgreen/source/test_upd.dat']) ~> FFWCustomerUpd
source(output(
cust_id as string,
eff_date as date,
end_date as date,
first_name as string,
last_name as string,
status as string
),
allowSchemaDrift: true,
validateSchema: false,
ignoreNoFilesFound: false,
isolationLevel: 'READ_UNCOMMITTED',
format: 'table') ~> source1
Exists1 alterRow(updateIf(1==1)) ~> AlterTeradataConnectorupd
source1 filter(end_date==toDate('9999-12-31')) ~> Filter1
FFWCustomerUpd, Filter1 exists(FFWCustomerUpd@cust_id == source1@cust_id,
negate:false,
broadcast: 'auto')~> Exists1
AlterTeradataConnectorupd sink(input(
cust_id as string,
eff_date as date,
end_date as date,
first_name as string,
last_name as string,
status as string
),
allowSchemaDrift: true,
validateSchema: false,
deletable:false,
insertable:false,
updateable:true,
upsertable:false,
keys:['cust_id'],
format: 'table',
mapColumn(
cust_id,
end_date = end_date_new
),
skipDuplicateMapInputs: true,
skipDuplicateMapOutputs: true) ~> TeradataConnectorupd
【问题讨论】:
标签: sql azure ssis azure-data-factory