azure数据工厂从容器递归复制

时间:2016-05-30 04:06:14

标签: azure recursion copy azure-data-factory

您好我正在使用Azure Data Factory进行复制活动。 我希望副本在容器中递归,并且子文件夹如下: MyFolder文件/年/月/日/小时} /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=**********"
    }
}

}

1 个答案:

答案 0 :(得分:2)

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

{
  "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时区的管道