cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Control query caching using SQL statement execution API

pranathisg97
New Contributor III

I want to execute this statement using databricks SQL Statement Execution API.

curl -X POST 
    -H 'Authorization: Bearer <access-token>' 
    -H 'Content-Type: application/json' 
    -d '{"warehouse_id": "<warehouse_id>", 
     "statement": "set use_cached_result = false;select * from <schema_name>.<table_name> limit 100", 
     "catalog": "dspf_test", 
     "wait_timeout": "50s", 
     "on_wait_timeout": "CANCEL", 
     "disposition": "EXTERNAL_LINKS"
     }' 
https://<databricks-host>/api/2.0/sql/statements/
 
 
 
 

but getting this error:

image.pngHow to use this "set use_cached_result = false" along with main query in single query statement using SQL Statement Execution API

SQL Statement Execution API Reference doc:

https://docs.databricks.com/api/workspace/statementexecution/executestatement

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @Pranathi Girish​, please check if you have replaced the placeholders with the actual values relevant to your environment.

View solution in original post

3 REPLIES 3

Kaniz
Community Manager
Community Manager

Hi @Pranathi Girish​, please check if you have replaced the placeholders with the actual values relevant to your environment.

Anonymous
Not applicable

Hi @Pranathi Girish​ 

We haven't heard from you since the last response from @Kaniz Fatma​ ​, and I was checking back to see if her suggestions helped you.

Or else, If you have any solution, please share it with the community, as it can be helpful to others. 

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

TimFrazer
New Contributor II

Did you ever find a solution to this problem?

Welcome to Databricks Community: Lets learn, network and celebrate together

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.