我正在尝试将来自CosmosDB的旧数据存档到Azure表中,但是我对Azure Data Factory还是陌生的,因此我不确定哪种方法是一个好方法。最初,我认为可以使用“复制活动”来完成此操作,但是由于存储在CosmosDB源文件中的文档的属性各不相同,因此出现了映射问题。有什么想法可以解决该归档过程吗?
[基本上,我要存储数据的方式是照原样复制文档根属性,并将嵌套的JSON存储为序列化的字符串。
例如,如果我要存档这两个文档:
[
{
"identifier": "1st Guid here",
"Contact": {
"Name": "John Doe",
"Age": 99
}
},
{
"identifier": "2nd Guid here",
"Distributor": {
"Name": "Jane Doe",
"Phone": {
"Number": "12345",
"IsVerified": true
}
}
}
]
我希望这些文档像这样存储在Azure表中:
identifier | Contact | Distributor
"Ist Guid here" | "{ \"Name\": \"John Doe\", \"Age\": 99 }" | null
"2nd Guid here" | null | "{\"Name\":\"Jane Doe\",\"Phone\":{\"Number\":\"12345\",\"IsVerified\":true}}"
复制活动有可能吗?
[我尝试使用CopyActivity中的映射选项卡,但是当我尝试运行它时,我收到一条错误消息,指出无法推断第一行中不存在的嵌套JSON列之一的数据类型。