3

I need to do something like a batch get using Azure table storage. I have a list of known RowKeys and PartitionKeys and I would like retrieve each one.

I was wondering if there was a better way than querying for each entity individually - like a batch GET.

In this answer, there is a proposed solution:

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"))));

But another answers mentions:

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!)

Is there a way to tell how long a table query is? Or a solution to safetly query the table using the proposed answer?

TomSelleck
  • 6,706
  • 22
  • 82
  • 151

1 Answers1

0

According to Azure Storage documentation, only 15 comparisons are permitted in the $filter.

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

Andy Shen
  • 962
  • 6
  • 7
  • 2
    I've found that I can do much more than that. The limitations that I run into are related to the length of the URL it seems. – Ronnie Overby Mar 04 '19 at 14:25
  • 1
    This is wrong. You can do more than 15 comparisons as @RonnieOverby says, refer to: https://stackoverflow.com/questions/43959589/max-filter-comparisons-in-an-azure-table-query – cenh Aug 06 '19 at 07:48