存在GetMetadata始终返回true

时间:2018-05-25 08:12:17

标签: azure azure-data-factory azure-data-factory-2

使用V2,我试图找出Azure blob存储中是否存在文件夹(我知道'文件夹'是伪名称,因为它只是文件URL的一部分) 。当我尝试这样做时,无论文件夹是否存在,它总是返回true。

下面是一个返回false的示例,但返回true。文件夹路径" test / 2018/5/25"不存在,但Get Metadata返回"存在:true,itemName:25"。存在其他文件夹路径,例如" test / 2018/5/24,但不存在以25结尾的文件夹路径,因为25日没有数据。

有什么想法吗?

管道

{
"name": "Testing",
"properties": {
    "activities": [
        {
            "name": "Get Metadata1",
            "type": "GetMetadata",
            "policy": {
                "timeout": "7.00:00:00",
                "retry": 0,
                "retryIntervalInSeconds": 30,
                "secureOutput": false
            },
            "typeProperties": {
                "dataset": {
                    "referenceName": "metdatatest",
                    "type": "DatasetReference"
                },
                "fieldList": [
                    "itemName",
                    "exists"
                ]
            }
        }
    ]
  }
}

数据集

{
"name": "metdatatest",
"properties": {
    "linkedServiceName": {
        "referenceName": "xxx",
        "type": "LinkedServiceReference"
    },
    "type": "AzureBlob",
    "typeProperties": {
        "format": {
            "type": "TextFormat",
            "columnDelimiter": "\t",
            "nullValue": "\\N",
            "treatEmptyAsNull": true,
            "skipLineCount": 1,
            "firstRowAsHeader": false
        },
        "fileName": "",
        "folderPath": "test/2018/5/25"
    }
  }
}

1 个答案:

答案 0 :(得分:1)

我可以重复一遍,这是一个错误。它目前返回它的容器是否存在,但没有检查这个"虚拟"是否存在。文件夹中。

由于blob没有文件夹概念,为了知道这样的文件夹是否存在,它需要进行文件搜索以检查是否有任何文件在此文件夹下,这可能会导致性能问题。我将回到PROD团队。请继续关注...