要解决ADF复制数据活动在CSV文件中创建多个行的问题,需要在映射数据流中使用flatten转换器。
示例代码如下:
{ "name": "dataflow1", "properties": { "type": "MappingDataFlow", "typeProperties": { "sources": [ { "dataset": { "referenceName": "myInputDataset", "type": "DatasetReference" }, "name": "input1" } ], "sinks": [ { "dataset": { "referenceName": "myOutputDataset", "type": "DatasetReference" }, "name": "output1" } ], "transformations": [ { "name": "flatten1", "type": "Flatten", "typeProperties": { "ignoreNullValues": false, "flattenArrays": true, "delimiter": ";", "outputDataType": "String", "inputColumns": [ "column1", "column2", "column3" ] } } ] } } }
其中,inputs中的"myInputDataset"和outputs中的"myOutputDataset"需要根据实际的数据集进行修改。flatten转换器中的inputColumns需要根据输入的列名进行设置。