我有数据工厂,其中源是 CSV,目标是 Azure SQL 数据仓库
Azure SQL 数据仓库中的表有一个额外的 DateTime 列,用于触发触发器的触发时间。
映射架构时如何让它工作?
注意:在 Azure SQL 数据仓库中,不可能像在 Azure SQL 数据库中那样拥有具有默认值 GETDATE() 的列。
SQL 数据仓库中的列是“InsertedOn”
我的管道如下所示:
{
"name": "Pipeline01",
"properties": {
"activities": [
{
"name": "CopyCSVtoDW",
"type": "Copy",
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"typeProperties": {
"source": {
"type": "BlobSource",
"recursive": true
},
"sink": {
"type": "SqlDWSink",
"allowPolyBase": false,
"writeBatchSize": 10000
},
"enableStaging": false,
"enableSkipIncompatibleRow": false,
"translator": {
"type": "TabularTranslator",
"columnMappings": {
"Id": "pointconnectnativeid",
"ValueDate": "valuedate",
"Value": "value",
"InsertedOn": "insertedon",
"forecastDate": "forecastDate"
}
}
},
"inputs": [
{
"referenceName": "SourceCSV",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "DestinationDW",
"type": "DatasetReference"
}
]
}
]
},
"type": "Microsoft.DataFactory/factories/pipelines"
}
这是我的来源:
{
"name": "SourceCSV",
"properties": {
"linkedServiceName": {
"referenceName": "skdwstorage",
"type": "LinkedServiceReference"
},
"parameters": {
"triggerDateTime": {
"type": "Object",
"defaultValue": "@trigger().startTime"
}
},
"type": "AzureBlob",
"structure": [
{
"name": "Id",
"type": "String"
},
{
"name": "ValueDate",
"type": "DateTime",
"format": "dd.MM.yyyy HH:mm:ss"
},
{
"name": "Value",
"type": "Decimal"
},
{
"name": "InsertedOn",
"type": "DateTime",
"description": "@trigger().startTime",
"format": "dd.MM.yyyy HH:mm:ss"
},
{
"name": "forecastDate",
"type": "DateTime",
"format": "dd.MM.yyyy HH:mm:ss"
}
],
"typeProperties": {
"format": {
"type": "TextFormat",
"columnDelimiter": "|",
"rowDelimiter": "\n",
"quoteChar": "\"",
"nullValue": "\\N",
"encodingName": null,
"treatEmptyAsNull": true,
"skipLineCount": 0,
"firstRowAsHeader": true
},
"fileName": "",
"folderPath": "csv"
}
},
"type": "Microsoft.DataFactory/factories/datasets"
}