如何使用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