gpt4 book ai didi

azure - 如何对写入 Blob 存储的 Azure 数据工厂文件进行可变命名?

转载 作者:行者123 更新时间:2023-12-02 06:33:11 24 4
gpt4 key购买 nike

我已使用向导创建了一个 ADF,该向导将数据从 Azure SQL 复制到 Blob 存储。

在指定输出文件名的选项(参见屏幕截图)中,我想附加到文件名、文件创建日期或其他一些变量值。有办法做到这一点吗?

ADF Screenshot

最佳答案

除了使用 the Data Factory Copy Wizard您还可以通过编辑控制文件创建的 OutputDataset 的 json 配置来更改 blob 文件的文件路径和/或文件名(在设置复制管道之后),如下所示:

  1. 转到 OutputDataset 表源(json 配置)。为此,您可以,例如,
    1. 打开数据工厂的“数据工厂”边栏选项卡。
    2. 在“内容”下,单击“数据集”以打开“数据集”边栏选项卡。
    3. 单击要调整其命名的 OutputDataset。这将打开 OutputDataset 边栏选项卡。
    4. 单击“表源”图 block 。您将定向到 OutputDataset 的 json 配置设置。
  2. 在partitionedBy属性下添加或调整变量,如下所示下面的例子。 (参见“firstCustomVariable”。)
  3. 根据您的需求调整文件名和/或文件路径以使用变量,如下例所示。 (参见例如“blobFileName-{firstCustomVariable}.json.gz”。)

另请参阅:
V1:Azure Data Factory - Functions and System Variables
V2:System variables supported by Azure Data Factory
V2:How to read or write partitioned data in Azure Data Factory version 2
Custom Date and Time Format Strings

示例:

{
"name": "OutputDataset-abc",
"properties": {
"published": false,
"type": "AzureBlob",
"linkedServiceName": "Destination-BlobStorage-abc",
"typeProperties": {
"fileName": "blobFileName-{firstCustomVariable}.json.gz",
"folderPath": "folderName-{secondCustomVariable}",
"format": {
"type": "JsonFormat",
"filePattern": "arrayOfObjects"
},
"partitionedBy": [
{
"name": "firstCustomVariable",
"value": {
"type": "DateTime",
"date": "SliceStart",
"format": "yyyyMMddHH"
}
},
{
"name": "secondCustomVariable",
"value": {
"type": "DateTime",
"date": "SliceStart",
"format": "MM"
}
}
],
"compression": {
"type": "GZip",
"level": "Fastest"
}
},
"availability": {
"frequency": "Day",
"interval": 1
},
"external": false,
"policy": {}
}
}

关于azure - 如何对写入 Blob 存储的 Azure 数据工厂文件进行可变命名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40341078/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com