02-08-2022 09:22 PM
I have setup authentication using this page https://docs.databricks.com/sql/api/authentication.html
and run
curl -n -X GET https://<databricks-instance>.cloud.databricks.com/api/2.0/sql/history/queries
To get history of all sql endpoint queries, but I want to get all queries for a particular day - say Jan 1st, 2021.
How do I do this? I don't see any examples in the documentation about this
02-10-2022 06:44 AM
Hi @John Constantine
To the above GET request add following raw data.
{
"filter_by": {
"endpoint_ids": ["<endpoint_id_1", "<endpoint_id_2", ...... "<endpoint_id_N"],
"query_start_time_range":{
"start_time_ms" :1640995200000,
"end_time_ms" : 1641081599000
}
},
"max_results": 999
}
Here,
1640995200000 refers to Saturday, January 1, 2022 12:00:00 AM GMT+0
1641081599000 refers to Saturday, January 1, 2022 11:59:59 PM GMT+0
Refer to Query API 2.0 documentation for more filters.
02-09-2022 05:40 AM
Hi @ Constantine! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers in the community have an answer to your question first. Or else I will get back to you soon. Thanks.
02-10-2022 06:44 AM
Hi @John Constantine
To the above GET request add following raw data.
{
"filter_by": {
"endpoint_ids": ["<endpoint_id_1", "<endpoint_id_2", ...... "<endpoint_id_N"],
"query_start_time_range":{
"start_time_ms" :1640995200000,
"end_time_ms" : 1641081599000
}
},
"max_results": 999
}
Here,
1640995200000 refers to Saturday, January 1, 2022 12:00:00 AM GMT+0
1641081599000 refers to Saturday, January 1, 2022 11:59:59 PM GMT+0
Refer to Query API 2.0 documentation for more filters.
03-07-2022 02:33 PM
Hi @John Constantine ,
Did @Aman Sehgal response helped you with your question? If it does, could you please mark it as best response.
12-05-2023 05:08 PM
Are you sure this works?
03-27-2024 11:01 AM
I get the same error message - databricks documentation is not showing a working example
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!
Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.