I am trying to get the first(oldest) n rows of data from a table in Azure Table Storage - but am unable to find any documentation that allows doing so via Python. I use an integer-based hash value as my PartitionKey and by default, the table is sorted by PartitionKey. However, I need to fetch the oldest n rows. Is there any way or feasible hack I can use to do this?
Unfortunately there is no solution. Server side sorting is not supported in table storage. If you want to sort by timestamp, you have to set the PartitionKey's value to the timestamp, and then the query result will be sorted by timestamp in the reverse order.
Get oldest n rows from Table in Azure Table Storage using Python