- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 07:42 AM
Hello,
I created a sql warehouse (cluster size = 2X-Small) and I wanted to use it to execute a query using the sql query api:
- url : https://databricks-host/api/2.0/preview/sql/statements
- params = {
'warehouse_id': 'warehouse_id',
'statement': 'SELECT * FROM db1.table1;',
'wait_timeout': '0s'
}
I got a response with a status 200 but with text in xml.
On the other hand when I use the queries api https://databricks-host/api/2.0/preview/sql/queries it works well, I have a json with all my queries already defined.
Best regards,
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 09:22 AM
@Yahya24 can you please remove preview in query, they are not in preview any more "/api/2.0/sql/statements/", you should see json response, can you please check drop down menu and change to json, some times it may be setted into text, but usual response in json
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 09:22 AM
@Yahya24 can you please remove preview in query, they are not in preview any more "/api/2.0/sql/statements/", you should see json response, can you please check drop down menu and change to json, some times it may be setted into text, but usual response in json
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:22 AM
Hello @karthik_p,
My problem is solved, I removed "preview" but the real problem comes from the type of the API, I use it as GET while it is POST.
Thank you very much.

