简体   繁体   English

Azure ADF v2-如何向要部署到Azure Data Lake的文件名添加/附加时间戳

[英]Azure ADF v2- How to add/append timestamp to file name getting deployed to Azure Data Lake

I am deploying a file to azure datalake but want to append datetime stamp to filename . 我正在将文件部署到Azure Datalake,但想将datetime stamp添加到filename。 I created a dataset and created a parameter with value as utcnow(). 我创建了一个数据集,并创建了一个值为utcnow()的参数。 But file is not getting deployed with timestamp appended. 但是文件没有在附加时间戳的情况下进行部署。

{ {

"name": "tst",

"properties": {

    "linkedServiceName": {

        "referenceName": "LS_ADLS_AzureDataLakeStoreLinkedService",

        "type": "LinkedServiceReference"

    },

    "parameters": {

        "customVariable": {

            "type": "String",

            "defaultValue": "utcnow()"

        }

    },

    "type": "AzureDataLakeStoreFile",

    "typeProperties": {

        "format": {

            "type": "TextFormat",

            "columnDelimiter": "|",

            "rowDelimiter": "",

            "nullValue": "",

            "treatEmptyAsNull": true,

            "skipLineCount": 0,

            "firstRowAsHeader": true

        },

        "fileName": "abc-{customVariable}",

        "folderPath": "clusters/diageo-eun-analytics-nonprod-hdi-hd-nampolaris-dev01/hive/warehouse/Spirit_Deal/tst",

        "partitionedBy": [

            {

                "name": "customVariable",

                "value": {

                    "type": "DateTime",

                    "date": "SliceStart",

                    "format": "yyyyMMddHH"

                }

            }

        ]

    }

},

"type": "Microsoft.DataFactory/factories/datasets"

} }

But filename is now coming with timestamp appended ie abc-{customVariable}.Please tell how to add in ADV v2 但是,文件名现在带有时间戳,即abc- {customVariable}。请说明如何在ADV v2中添加

You definitely can parameterize file names and pathes. 您绝对可以参数化文件名和路径。 Phps. you try @CONCAT. 您尝试@CONCAT。 The following example works, showing how to build folder pathes and filenames dynamically: 以下示例有效,显示了如何动态构建文件夹路径和文件名:

{
    "name": "TgtADLSSQL",
    "properties": {
        "linkedServiceName": {
            "referenceName": "Destination-DataLakeStore-gqf",
            "type": "LinkedServiceReference"
        },
        "folder": {
            "name": "Target"
        },
        "type": "AzureDataLakeStoreFile",
        "typeProperties": {
            "format": {
                "type": "ParquetFormat"
            },
            "fileName": {
                "value": "@CONCAT('Ingest_Date=', formatDateTime(trigger().startTime, 'yyyy-MM-dd/'),'Incremental-', pipeline().RunId, '.snappy.parquet')",
                "type": "Expression"
            },
            "folderPath": {
                "value": "/data/raw/corporate/sql/@{item().TABLE_NAME}",
                "type": "Expression"
             }
        }
    },
    "type": "Microsoft.DataFactory/factories/datasets"
}

See also Dynamic folders in ADF V2 . 另请参阅ADF V2中的动态文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将数据附加到现有的 Azure 数据湖文件中? - How to append data into existing Azure data lake file? 如何将日期时间附加到按数据工厂发布到Azure Data Lake Store的文件名? - How to append the datetime to the file name which publish to Azure Data Lake Store by Data factory? Azure Data Lake文件名与目标的映射 - Azure Data lake File Name mapping with target 使用Azure数据工厂(ADF)仅从Azure Data Lake存储中复制最新文件 - Copy only the latest file from azure data lake store with Azure Data Factory (ADF) 如何在 Azure 数据湖中打开 ORC 文件? - How to open an ORC File in Azure data lake? 如何通过 Azure Data Lake Store gen1 中的新文件触发 Azure Data Factory v2 或 Azure Databricks Notebook 中的管道 - How to trigger a pipeline in Azure Data Factory v2 or a Azure Databricks Notebook by a new file in Azure Data Lake Store gen1 使用 ADF 将 14gb 文件从 ftp 复制到 azure 数据湖存储 - copying 14gb file from ftp to azure data lake store using ADF 使用 ADF/ADB/PowerShell 将 MS 团队的 excel 文件下载到 Azure Data Lake - Downloading excel file from MS teams into Azure Data Lake using ADF/ADB/PowerShell 添加动态内容-Azure数据工厂ADF V2 - Add Dynamic Content - Azure Data Factory ADF V2 Azure Data Lake Analytics IOutputter 获取输出文件名 - Azure Data Lake Analytics IOutputter get output file name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM