Skip to content

Commit 8929c62

Browse files
authored
Merge pull request #577 from Micro-Yangzai/zhuzhan/sapodpinsert
update template SapOdp to already insert data to sink
2 parents 14430de + 4114bd6 commit 8929c62

File tree

3 files changed

+27
-53
lines changed

3 files changed

+27
-53
lines changed

templates/SAP ODP to ADLS Gen2 in Parquet format/SAP ODP to ADLS Gen2 in Parquet format.json renamed to templates/Always Insert SAP ODP data to sink/Always Insert SAP ODP data to sink.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,27 @@
22
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5-
"workspaceName": {
5+
"factoryName": {
66
"type": "string",
7-
"metadata": "Workspace name",
8-
"defaultValue": "zzysynapsecanary"
7+
"metadata": "Data Factory name"
98
},
10-
"zhuzhangen2LS": {
9+
"DataSource_LinkService": {
1110
"type": "string"
1211
},
13-
"SapOdp1": {
12+
"SapOdp3": {
1413
"type": "string"
1514
}
1615
},
1716
"variables": {
18-
"workspaceId": "[concat('Microsoft.Synapse/workspaces/', parameters('workspaceName'))]"
17+
"factoryId": "[concat('Microsoft.DataFactory/factories/', parameters('factoryName'))]"
1918
},
2019
"resources": [
2120
{
22-
"name": "[concat(parameters('workspaceName'), '/SAP ODP to ADLS Gen2 in Parquet format')]",
23-
"type": "Microsoft.Synapse/workspaces/pipelines",
24-
"apiVersion": "2019-06-01-preview",
21+
"name": "[concat(parameters('factoryName'), '/Always Insert SAP ODP data to sink')]",
22+
"type": "Microsoft.DataFactory/factories/pipelines",
23+
"apiVersion": "2018-06-01",
2524
"properties": {
26-
"description": "Use this template to replicate multiple tables from SAP to Azure Data Lake Gen2 in Parquet format with additional operation type column, e.g., Upsert, Delete.",
25+
"description": "Insert each row of sap odp data to sink, no update, delete operation.",
2726
"activities": [
2827
{
2928
"name": "SAP2ParquetLookup",
@@ -130,7 +129,7 @@
130129
},
131130
"staging": {
132131
"linkedService": {
133-
"referenceName": "[parameters('zhuzhangen2LS')]",
132+
"referenceName": "[parameters('DataSource_LinkService')]",
134133
"type": "LinkedServiceReference"
135134
},
136135
"folderPath": {
@@ -160,20 +159,20 @@
160159
"cancelAfter": {}
161160
},
162161
"annotations": [],
163-
"lastPublishTime": "2023-05-19T02:37:53Z"
162+
"lastPublishTime": "2023-05-22T07:57:59Z"
164163
},
165164
"dependsOn": [
166-
"[concat(variables('workspaceId'), '/datasets/SapToParquetLookupJson')]",
167-
"[concat(variables('workspaceId'), '/dataflows/SAP2ParquetTemplateDataflow')]"
165+
"[concat(variables('factoryId'), '/datasets/SapToParquetLookupJson')]",
166+
"[concat(variables('factoryId'), '/dataflows/SAP2ParquetTemplateDataflow')]"
168167
]
169168
},
170169
{
171-
"name": "[concat(parameters('workspaceName'), '/SapToParquetLookupJson')]",
172-
"type": "Microsoft.Synapse/workspaces/datasets",
173-
"apiVersion": "2019-06-01-preview",
170+
"name": "[concat(parameters('factoryName'), '/SapToParquetLookupJson')]",
171+
"type": "Microsoft.DataFactory/factories/datasets",
172+
"apiVersion": "2018-06-01",
174173
"properties": {
175174
"linkedServiceName": {
176-
"referenceName": "[parameters('zhuzhangen2LS')]",
175+
"referenceName": "[parameters('DataSource_LinkService')]",
177176
"type": "LinkedServiceReference"
178177
},
179178
"annotations": [],
@@ -253,16 +252,16 @@
253252
"dependsOn": []
254253
},
255254
{
256-
"name": "[concat(parameters('workspaceName'), '/SAP2ParquetTemplateDataflow')]",
257-
"type": "Microsoft.Synapse/workspaces/dataflows",
258-
"apiVersion": "2019-06-01-preview",
255+
"name": "[concat(parameters('factoryName'), '/SAP2ParquetTemplateDataflow')]",
256+
"type": "Microsoft.DataFactory/factories/dataflows",
257+
"apiVersion": "2018-06-01",
259258
"properties": {
260259
"type": "MappingDataFlow",
261260
"typeProperties": {
262261
"sources": [
263262
{
264263
"linkedService": {
265-
"referenceName": "[parameters('SapOdp1')]",
264+
"referenceName": "[parameters('SapOdp3')]",
266265
"type": "LinkedServiceReference"
267266
},
268267
"name": "SAPSource"
@@ -271,15 +270,16 @@
271270
"sinks": [
272271
{
273272
"linkedService": {
274-
"referenceName": "[parameters('zhuzhangen2LS')]",
273+
"referenceName": "[parameters('DataSource_LinkService')]",
275274
"type": "LinkedServiceReference"
276275
},
277276
"name": "ParquetSink"
278277
}
279278
],
280279
"transformations": [
281280
{
282-
"name": "AddOperationTypeColumn"
281+
"name": "InsertEachRow",
282+
"description": "Update each row to insert, no mater update, delete or insert."
283283
}
284284
],
285285
"scriptLines": [
@@ -303,8 +303,8 @@
303303
" keys: ($sapKeyColumns),",
304304
" partitionPredicates: ($sapPartitions),",
305305
" partitionBy('external', 1)) ~> SAPSource",
306-
"SAPSource derive(OperationType = case(isUpsert(),'Upsert', isDelete(), 'Delete', isUpdate(), 'Update', isInsert(), 'Insert')) ~> AddOperationTypeColumn",
307-
"AddOperationTypeColumn sink(allowSchemaDrift: true,",
306+
"SAPSource alterRow(insertIf(true())) ~> InsertEachRow",
307+
"InsertEachRow sink(allowSchemaDrift: true,",
308308
" validateSchema: false,",
309309
" format: 'parquet',",
310310
" fileSystem: ($parquetContainer),",

0 commit comments

Comments
 (0)