I wanted to create an automation script that connect and fetches data from databricks. Then using these data I will create a dashboard using ad hoc data source.
May I know how I can create this solution? I tried looking at all the documentation and examples but could not find anything that helps.
Thanks.
Hi Zhing Hang,
I assume you can access the data you need from Databricks through an API. In that case, you can indeed create an ad hoc data source to fetch that data and use it in your dashboard.
There is a tutorial available which does the same thing, instead of using the Databricks API it uses another API (to fetch data about satellites), but conceptionally it's the same:
Written tutorial: https://docs.dataminer.services/user-guide/Advanced_Modules/Dashboards_and_Low_Code_Apps/GQI/Extensions/Ad_hoc_data/Ad_hoc_Tutorials_Satellites.html
Video format: https://community.dataminer.services/video/kata-4-build-your-first-gqi/
Were you able to check/find these examples (helpful)?
Edit: Do note that the tutorial and video don't go to much in detail about actually fetching the data from the API. But once you have that 'example' downloaded from the catalog, you can take a look at how the implementation works. -> Let me know if you have additional questions.
private IReadOnlyList<Satellite> FetchSatellites()
{
var request = WebRequest.Create(URL);
using (var response = request.GetResponse())
using (var stream = response.GetResponseStream())
using (var reader = new StreamReader(stream, Encoding.Default))
{
return ReadSatellites(reader, true);
}
}
Hope this helps!
Best regards,
Ward
Hi, can anyone help to support me on this?
Hi Ward, thank you for your reply. The links you sent me is somehow useful however as you mentioned, the link did not go into details on the API implementation. I have been struggling mostly with the API implementation part because this example uses a web request and parse in a url, but I need also to parse in a body that contains an SQL statement to the databricks API. Could you advise me how can I do that?