【发布时间】:2019-08-31 03:20:28
【问题描述】:
我正在使用复制数据活动将数据从 REST 服务复制到 Azure SQL Server。 REST 服务返回分层 JSON 响应,我正在使用模式映射将其推送到 SQL 表中。这按预期工作,除了一些名称中包含空格的属性。这是一个示例架构映射,其中最后一个属性定义了相关的属性:
"translator": {
"type": "TabularTranslator",
"schemaMapping": {
"id": "id",
"type": "type",
"lead_verb": "lead_verb",
"lead_action_performed": "lead_action_performed",
"created_at": "created_at",
"lead_id": "lead_id",
"selected_action": "selected_action",
"rate_type": "rate_type",
"channel_rate_id": "channel_rate_id",
"tenant_id": "tenant_id",
"unit_id": "unit_id",
"created_by_id": "created_by_id",
"source_id": "source_id",
"lead_changes_humanized.Quoted Rate[1]": "lead_changes_humanized"
},
"collectionReference": "$.lead_events"
}
这会导致以下错误:
{
"errorCode": "2200",
"message": "ErrorCode=UserErrorInvalidJsonArrayPathDefinition,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error occurred when deserializing source JSON data. Please check whether the JsonPath in JsonNodeReference and JsonPathDefintion is valid.,Source=Microsoft.DataTransfer.Common,''Type=Newtonsoft.Json.JsonException,Message=Unexpected character while parsing path: ,Source=Newtonsoft.Json,'",
"failureType": "UserError",
"target": "cpyCompaniesLeadEvents"
}
我试过引用路径如下:
"lead_changes_humanized.\"Quoted Rate\"[1]": "lead_changes_humanized"
并且,用单引号:
"lead_changes_humanized.'Quoted Rate'[1]": "lead_changes_humanized"
这些都会导致相同的错误。我已经使用路径验证器验证了 JSON 路径。
问题:我该如何处理这个空白?
【问题讨论】:
标签: azure-data-factory azure-data-factory-2