I have a Windows Azure Storage table in which i am storing more than 1000k+ rows(entities).
I want to perform a few aggregate functions on the table, for example counting on
a specific column for a specific condition, average
, total
, min
, max
and group by
(as in normal SQL). How can I do that in windows Azure Storage tables?
Azure Functions integrates with Azure Storage via triggers and bindings. Integrating with Table storage allows you to build functions that read and write Table storage data. The Table storage bindings are provided in the Microsoft.Azure.WebJobs.Extensions.Storage NuGet package, version 3.x.
Log into the Azure portal, go to the Functions App, and under QueueIntegrationDemo function, click on "Integrate". In the "Integrate" window, we need to add a new output which is Azure Table Storage, as shown in the below image.
The following articles provide details about aggregate functions supported by Azure Data Factory and Azure Synapse Analytics in mapping data flows. The following functions are only available in aggregate, pivot, unpivot, and window transformations. Gets the approximate aggregate count of distinct values for a column.
Azure Table storage is a service that stores structured NoSQL data in the cloud, providing a key/attribute store with a schemaless design. This post builds on some other posts I've done,
The only way is pretty much to pull down all your entities and run your aggregates on them in memory.
If you have to keep this information up to date I would store these aggregates in another place and update them every time a new entity is added. For instance the average is the sum/count
so you can have a table item that stores the current sum and count and when you add a new entity also update the sum and count values.
Make sure to use optimistic concurrency so you can catch any race conditions etc. If your table entities share the same partition key then you can even do the operation on the same transaction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With