TableQuery.CombineFilters中FilterCondition的最大数量

问题描述 投票:1回答:1

我需要做一些像使用Azure表存储的批量获取。我有一个已知RowKeys和PartitionKeys的列表,我想检索每一个。

我想知道是否有比单独查询每个实体更好的方法 - 就像批量GET一样。

this answer,有一个建议的解决方案:

TableQuery<DynamicTableEntity> query = new TableQuery<DynamicTableEntity>()
  .Where(TableQuery.CombineFilters( 
    TableQuery.GenerateFilterCondition("PartitionKey", 
    QueryComparisons.Equal, "partition1"),
    TableOperators.And,
    TableQuery.CombineFilters(
    TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, "row1"),
    TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, "row2"))));

但另一个答案提到:

There is (or course) a URL length limitation to the query. If you exceed the length, the query will still succeed because the service can not tell that the URL was truncated. In our case, we limited the combined query length to about 2500 characters (URL encoded!)

有没有办法告诉表查询有多长?或者使用建议的答案安全地查询表格的解决方案?

azure azure-table-storage azure-tablequery
1个回答
1
投票

根据Azure存储文档,$ filter中只允许进行15次比较。

https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities

© www.soinside.com 2019 - 2024. All rights reserved.