【问题标题】:How to read the files from Azure Blob Storage with folder structure as 'StartDateOfMonth-EndDatefMonth'?如何从 Azure Blob 存储中读取文件夹结构为“StartDateOfMonth-EndDatefMonth”的文件?
【发布时间】:2019-11-07 03:22:00
【问题描述】:

场景

我们有具有以下文件夹结构的 azure blob 存储容器。 • 20190601-20190630

基本上,此文件夹将包含给定月份的每日 CSV 文件。

此文件夹结构是动态的。因此,在下个月,文件夹 20190701-20190731 将被每日 CSV 文件填充。

问题

每天,需要使用 azure 数据工厂 (v2) 将这些文件从 azure blob 存储移动到 azure 数据湖。

如何在 Azure 数据工厂(V2)的输入数据集(Azure Blob 存储)中指定文件夹结构(动态)?

示例: 20190601-20190630/*.CSV 代表 2019 年 6 月

基本上,StartDateOfMonth 和 EndDateOfMonth 是动态的。

提前致谢

【问题讨论】:

    标签: azure-data-factory-2


    【解决方案1】:

    您可以像这样配置数据集文件夹路径:

       "folderPath": {
                            "value": "@concat( 
                                   formatDateTime(pipeline().parameters.scheduledRunTimeStart, 'yyyyMMdd'), 
                                   '-',
                                   formatDateTime(pipeline().parameters.scheduledRunTimeEnd, 'yyyyMMdd')
                                   , '/'
                            "type": "Expression"
        }
    

    并将参数传入数据集:

    "parameters": {
        "scheduledRunTimeStart": {
            "type": "String"
        },
        "scheduledRunTimeEnd": {
            "type": "String"
        }
    }
    

    【讨论】:

    • 传递日期时间参数是正确的,但是我们需要传递StartDateOfMonthEndDateOfMonth。父文件夹结构如下 六月月 - 20190601-2019063 七月 - 20190701-20190731 八月 - 20190801-20190830
    • @MangeshT。您可以首先按照您的规则格式化日期字符串,然后将它们作为参数传递到管道中。 Fox 示例,使用 java Calendar jar sdk:stackoverflow.com/questions/14241836/…
    猜你喜欢
    • 2021-07-08
    • 2012-06-16
    • 1970-01-01
    • 2021-01-31
    • 1970-01-01
    • 2021-10-18
    • 2021-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多