I've been working on some tools to sync data from NetApp Cloud Insights DWH (Data Warehouse) to an on-premise MySQL Database - MySQL is the closest on-premise match for the Cloud Insights DWH and OnCommand Insight used MySQL for its Data Warehouse - and making good progress.
On thing I wanted to do was find the maximum technical key, a good example is:
SELECT MAX(tk) FROM dwh_capacity.date_dimension
The following python script can do just that.
Save the script as say FindLatestTk.py and run as:
python FindLatestTk.py tokenFile.txt https://YOURTENANT.cloudinsights.netapp.com dwh_capacity date_dimension tk
Image: Example running FindLatestTk.py
It does 3 main things:
- Create a custom MySQL query using ODATA (or MySQL view)
- Gets the output of running the custom query
- Deletes the custom MySQL query