【问题标题】:azure data factory recursive copy from container来自容器的天蓝色数据工厂递归副本
【发布时间】:2016-05-30 04:06:14
【问题描述】:

您好,我正在使用 Azure 数据工厂进行复制活动。 我希望副本在容器中递归,它的子文件夹如下: 我的文件夹/年/月/日/小时}/New_Generated_File.csv

我生成并导入文件夹的文件总是有不同的名称。

问题是活动似乎永远在等待。

管道每小时安排一次。

我正在附上数据集和链接服务的 json 代码。

数据集:

{
"name": "Txns_In_Blob",
"properties": {
    "structure": [
        {
            "name": "Column0",
            "type": "String"
        },
        [....Other Columns....]
    ],
    "published": false,
    "type": "AzureBlob",
    "linkedServiceName": "LinkedService_To_Blob",
    "typeProperties": {
        "folderPath": "uploadtransactional/yearno={Year}/monthno={Month}/dayno={Day}/hourno={Hour}/{Custom}.csv",
        "format": {
            "type": "TextFormat",
            "rowDelimiter": "\n",
            "columnDelimiter": "    "
        }
    },
    "availability": {
        "frequency": "Hour",
        "interval": 1
    },
    "external": true,
    "policy": {}
}

}

关联服务:

{
"name": "LinkedService_To_Blob",
"properties": {
    "description": "",
    "hubName": "dataorchestrationsystem_hub",
    "type": "AzureStorage",
    "typeProperties": {
        "connectionString": "DefaultEndpointsProtocol=https;AccountName=wizestorage;AccountKey=**********"
    }
}

}

【问题讨论】:

    标签: azure recursion copy azure-data-factory


    【解决方案1】:

    在数据集的folderPath 属性中提供文件名不是强制性的。只需删除文件名,然后数据工厂将为您加载所有文件。

    {
      "name": "Txns_In_Blob",
      "properties": {
        "structure": [
            {
                "name": "Column0",
                "type": "String"
            },
            [....Other Columns....]
        ],
        "published": false,
        "type": "AzureBlob",
        "linkedServiceName": "LinkedService_To_Blob",
        "typeProperties": {
            "folderPath": "uploadtransactional/yearno={Year}/monthno={Month}/dayno={Day}/hourno={Hour}/",
            "partitionedBy": [
                { "name": "Year", "value": { "type": "DateTime", "date": "SliceStart", "format": "yyyy" } },
                { "name": "Month", "value": { "type": "DateTime", "date": "SliceStart", "format": "%M" } },
                { "name": "Day", "value": { "type": "DateTime", "date": "SliceStart", "format": "%d" } },
                { "name": "Hour", "value": { "type": "DateTime", "date": "SliceStart", "format": "hh" } }
            ],
            "format": {
                "type": "TextFormat",
                "rowDelimiter": "\n",
                "columnDelimiter": "    "
            }
        },
        "availability": {
            "frequency": "Hour",
            "interval": 1
        },
        "external": true,
        "policy": {}
    }
    

    上面的folderPath会生成运行时值 uploadtransactional/yearno=2016/monthno=05/dayno=30/hourno=07/ 用于现在执行 UTC 时区的管道

    【讨论】:

    • 感谢您的回答。你说的是对的,我也试过了,但为什么管道永远在等待?我检查了参数“外部”设置为假。我收到此错误:Blob wizestorage.blob.core.windows.net/upl/yearno={Year}/monthno={Month}/dayno={Day}/hourno={Hour}/ 不存在似乎它没有将脚本转换为实际路径。
    • 您是否定义了将值分配给{Hour} {Year} 等的逻辑?
    • 如果数据集被标记为外部,那么管道将立即执行。如果设置为 false,那么它将一直等待,直到某个 其他管道生成数据集
    • 感谢 Sandesh,你很棒。您如何定义将值分配给 {Hour} {Year} 等的逻辑?
    • 我已经更新了答案以提供为 {Hour} 和其他人分配值的逻辑
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多