ADF 中copy data activity的mapping的dynamic content
在ADF (Azure Data Factory) 中,Copy Data Activity 的 Mapping 属性可以使用动态内容来定义。以下是使用动态内容的一些示例:
- 使用参数作为动态内容:
"mapping": {
"type": "TabularTranslator",
"translator": {
"type": "TabularTranslator",
"mappings": [
{
"source": {
"name": "@pipeline().parameters.sourceColumnName",
"type": "String"
},
"sink": {
"name": "targetColumnName",
"type": "String"
}
}
]
}
}
- 使用函数作为动态内容:
"mapping": {
"type": "TabularTranslator",
"translator": {
"type": "TabularTranslator",
"mappings": [
{
"source": {
"name": "@concat('source_', formatDateTime(utcnow(), 'yyyyMMdd'))",
"type": "String"
},
"sink": {
"name": "targetColumnName",
"type": "String"
}
}
]
}
}
- 使用变量作为动态内容:
"mapping": {
"type": "TabularTranslator",
"translator": {
"type": "TabularTranslator",
"mappings": [
{
"source": {
"name": "@variables('sourceColumnName')",
"type": "String"
},
"sink": {
"name": "targetColumnName",
"type": "String"
}
}
]
}
}
通过使用动态内容,可以根据参数、函数或变量的值来动态定义 Copy Data Activity 的 Mapping 属性,从而实现更加灵活和可重用的数据复制操作
原文地址: https://www.cveoy.top/t/topic/imrj 著作权归作者所有。请勿转载和采集!