如何通过使用azuredatafactory将多个文件从azure blob加载到azure synapse(Dw)?

问题描述 投票:0回答:1

我正在尝试通过使用azure数据工厂将多个文件从azure blob加载到azure sql dw。下面是我的代码。而且我正面临突出显示的错误。有人可以建议。我在这里粘贴我的adf代码json。

我正在下面处于复制活动阶段突出显示的位置。

{
    "name": "DelimitedText11",
    "properties": {
        "linkedServiceName": {
            "referenceName": "AzureBlobStorage2",
            "type": "LinkedServiceReference"
        },
        "parameters": {
            "FileName": {
                "type": "string"
            }
        },
        "annotations": [],
        "type": "DelimitedText",
        "typeProperties": {
            "location": {
                "type": "AzureBlobStorageLocation",
                "fileName": {
                    "value": "@dataset().FileName",
                    "type": "Expression"
                },
                "container": "input"
            },
            "columnDelimiter": ",",
            "escapeChar": "",
            "firstRowAsHeader": true,
            "quoteChar": ""
        },
        "schema": []
    },
    "type": "Microsoft.DataFactory/factories/datasets"
}

错误:

{
        "errorCode": "2200",
        "message": "ErrorCode=UserErrorMissingPropertyInPayload,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Required property 'fileName' is missing in payload.,Source=Microsoft.DataTransfer.ClientLibrary,'",
        "failureType": "UserError",
        "target": "Copy data1",
        "details": []
    }
azure-data-factory azure-container-service azure-synapse
1个回答
1
投票

如果要将多个文件从azure blob加载到Azure SQL数据仓库,请在源数据集中设置Wildcard file path。否则,您将始终收到错误2200:

{
        "errorCode": "2200",
        "message": "ErrorCode=UserErrorMissingPropertyInPayload,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Required property 'fileName' is missing in payload.,Source=Microsoft.DataTransfer.ClientLibrary,'",
        "failureType": "UserError",
        "target": "Copy data1",
        "details": []
    }

例如,我有两个具有相同架构的csv文件,并将它们加载到我的Azure SQL数据仓库表test

Csv文件:

enter image description here

源数据集:

enter image description here

源设置:在源容器中选择所有csv文件:

enter image description here

接收器数据集:

enter image description here

接收器设置:

enter image description here

映射:enter image description here

设置:enter image description here

执行管道并检查ADW中的数据:enter image description here

enter image description here

希望这会有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.