TableQuery.CombineFilters中FilterCondition的最大数量

时间:2017-12-24 11:40:10

标签: azure azure-table-storage azure-tablequery

我需要做一些像使用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!)

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

1 个答案:

答案 0 :(得分:1)

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

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

相关问题