raphaelblg
Databricks Employee
Databricks Employee

@Kutbuddin this is true, streaming queries are asynchronous and won't delay your code execution if not awaited for.

You can see in the example below that right after the query starts, the status is 'Initializing sources':

raphaelblg_0-1716922667104.png

But when using awaitTermination() the next row of code will only be executed after the query finishes:

raphaelblg_1-1716922758147.png

 

Best regards,

Raphael Balogo
Sr. Technical Solutions Engineer
Databricks

View solution in original post