cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to set call back for Databricks Statement Execution SQL API Query?

Maulik
New Contributor

I m using https://docs.databricks.com/api/workspace/statementexecution. using long running queries.my wait time is zero. queries might take 1 hour and I don't want to do pooling https://docs.databricks.com/api/workspace/statementexecution/getstatement the way they explain in above link. I m using queries with SQL api not using note book. do we have any way without pooling we can use some call back mechanism to get notify that your result is ready and then only I ask for result ?

 
1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @MaulikWhen dealing with long-running queries in Databricks, there are a few strategies you can consider to optimize performance and avoid pooling.

Let’s explore some options:

  1. Query Optimization:

  2. Pooling:

  3. Callback Mechanism:

    • Unfortunately, Databricks doesn’t provide a built-in callback mechanism to notify when query results are ready. However, you can implement your own custom solution:
      • Run the query asynchronously.
      • Periodically check the query status using the Databricks REST API.
      • When the query completes, retrieve the results.

Remember to adjust the spark.databricks.hive.metastore.client.pool.size configuration parameter to o...4. If you encounter specific issues, consider monitoring network logs and checking connectivity to the Hive metastore.

Feel free to explore these options and adapt them to your specific use case. If you have further questions or need additional assistance, feel free to ask! 😊

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group