使用V2,我试图找出Azure blob存储中是否存在文件夹(我知道“文件夹”是一个伪名称,因为它只是文件url的一部分)。当我尝试执行此操作时,无论该文件夹是否存在,它总是返回 true。
下面是一个示例,它应该返回 false,但返回 true。文件夹路径“test/2018/5/25”不存在,但获取元数据返回“exists: 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"
}
}
}
我可以重现相同的内容,这是一个错误。它当前返回其容器是否存在,但没有检查这个“虚拟”文件夹是否存在。
由于blob没有文件夹概念,为了知道是否存在这样的文件夹,需要进行文件搜索来检查该文件夹下是否有文件,这可能会导致性能问题。我将回到 PROD 团队。请继续关注...
这个问题解决了吗?,对于空容器(获取元数据-活动),它仍然显示 Exists = True。 如果容器为空,我希望它返回 False