若要在ADF复制活动中使用附加列,下面是一种可行的方法:
1.在数据流中定义附加列,例如:
"sourceData": { "type": "TabularSource", "sourceOptions": { "additionalColumns": [ { "name": "extraColumn", "type": "String" } ] } }
2.在复制活动运行期间,使用“映射数据流”活动传输数据流,导入附加列。例如:
"activities":[ { "name": "CopyData", "type": "Copy", "inputs": [ { "referenceName": "inputDataset", "type": "DatasetReference" } ], "outputs": [ { "referenceName": "outputDataset", "type": "DatasetReference" } ], "source": { "type": "TabularSource", "query": "SELECT * from sourceTable" }, "sink": { "type": "TabularSink", "writeBatchSize": 10000 }, "dataFlow": { "referenceName": "myDataFlow", "type": "DataFlowReference" }, "enableStaging": false } ]
在数据流活动中定义映射以'extraColumn”添加到输出数据集,如下所示:
{ "name": "myMapping", "type": "MappingDataFlow", "sources": [ { "dataset": { "referenceName": "inputDataset", "type": "DatasetReference" } } ], "sinks": [ { "dataset": { "referenceName": "outputDataset", "type": "DatasetReference" }, "writeBehavior": "insert" } ], "transformation": { "name": "mySource", "source": { "type": "SourceTransformation", "dataset": { "referenceName": "inputDataset", "type": "DatasetReference" }