I've implemented a methods to count all entities retrieved from a query. If the entities are more then 1000 I use the continuation tokens to continue
public static function countResults($storageAccountName, $tableName, $filter, $projections = null)
{
$count = 0;
$options = null;
$continue = false;
do
{
$options = Azure::getEntitiesFromTable($storageAccountName, $tableName, $filter, $projections, $options);
$currentResults = $options->getEntities();
$count += count($currentResults);
// if specified it means there are other results
$continue = (!is_null($options->getNextPartitionKey()) && !is_null($options->getNextRowKey()));
} while ($continue);
return $count;
}
simply I return the QueryEntitiesResult object and I use it as input of the method that execute the filter where it get the partition key and row key and set them to the QueryEntitiesOptions object passed to the TableRestProxy->queryEntities
So nothing is applied to the continuation tokens. The problem is that the TableRestProxy->queryEntities applies the $this->_encodeODataUriValue to the pkey and rowkey. This invalidates the tokens and are always returned the same first 1000 results. Removing the encoding it works. Is it a bug of the library?