Datafactory出现Type=System.ArgumentException,Message=An item with the same key has already been的错误

在Azure Datafactory上创建copy data出现

Type=System.ArgumentException,Message=An item with the same key has already been added.,Source=mscorlib,'的错误,如图所示

Datafactory出现Type=System.ArgumentException,Message=An item with the same key has already been的错误_第1张图片

copydata的source和sink如下所示:

Datafactory出现Type=System.ArgumentException,Message=An item with the same key has already been的错误_第2张图片

我们可以看到source读取的行数为0,说明读取源数据的时候就出现问题了,后来经过查询是因为数据集使用了源数据csv文件的第一行作为字段,

而csv中出现了重复的列,虽然mapping的时候会给重复列排序,但是你去读取源文件的时候可能只会根据实际列名去找对应列数据,所以才会出现

An item with the same key has already been added的错误。

解决方法:

1: 在创建源数据集的时候不勾选first row as header选项

Datafactory出现Type=System.ArgumentException,Message=An item with the same key has already been的错误_第3张图片

2:copy data的source时候选择“skip row count”,即跳过字段名的第一列

Datafactory出现Type=System.ArgumentException,Message=An item with the same key has already been的错误_第4张图片

3:copy data的Mapping时根据生成的序号对应自己的sink表mapping字段

这样的话就不会出现重复列了

 

 

你可能感兴趣的:(菜鸟阶段,data,factory)