Forum Discussion
Delayed data refresh in SQL Analytical Endpoint
- 2 years ago
So my info from Microsoft is that it should take a few seconds to a minute for the SQL Endpoint to discover the updated delta logs. They did have an issue which was fixed apparently.
If your issue persists it would be worth logging that with MS support and give them you workspace ID, lakehouse id, and time it was happening
Hi, I am aware of this setting and I enabling it whenever possible. But sometimes, due to data type errors or other refresh issues this setting gets automatically disabled.
And in this case I dont really case about the default Direct Lake dataset - I only want to query my Delta Lake tables with T-SQL via the SQL endpoint (something that always works flawlessly with no refresh delay in Synapse).
My understanding is that the SQL endpoint is not dependent on the default dataset. Or is it? I should be able to unselect all tables from the SQL endpoint from the default dataset (and end up with an empty dataset), but still be able to query the SQL endpoint.
Are you saying that im wrong, and there is a circle reference going on here? The metadata in the SQL endpoint needs to be updated in order to select what tables to include in the default dataset, but the default dataset needs to be up-to-date (reframed) in order to present data in the SQL endpoint? 😕 That doesnt make much sense, and I hope this is not the case?
Im trying to understand if there is some "reframing" activity going on under the hood even for the SQL endpoint, causing the delay I am experiencing..
The SQL Endpoint isn't dependant on the default dataset (the other way round is true though). OK, so just to confirm, if you query the delta data via the shortcut table using SQL via the SQL Endpoint can you see the updated data? I've just tested now where I have a delta table being written to (overwrite mode) using a Synapse notebook, and then querying that using a shortcut in Fabric Lakehouse SQL Endpoint and I can see the updated data as soon as its written to the external data lake folder.
Update: I've also testing with a report in power bi on the default dataset and I can see the data as soon as it refreshes in the external data lake.
- FelixL2 years agoAdvocate II
I also load all my data using Synapse notebooks, using overwrite mode. When I query the table in the SQL endpoint in Fabric the data is updated within seconds from when the underlying delta table is updated most of the time - but sometime it takes up to a few minutes for the SQL endpoint to reflect the change in data.
This (somewhat short) delay is what messes with my API triggered dataset refreshes. I would assume that when my activity to load the delta lake table is done, its safe to run the dataset refresh. But this is not always the case. Whenever data has failed to appear in the dataset I always go right back to the SQL endpoint and query the table, at which point I can always see the new/todays data there
I have added a "5 minute wait" activity in my pipeline, and it now works "most of the time", but still sometimes fail to fetch new data, leading me to believe that 5 minutes is not enough in all cases. I will extend this wait activity to 10-15 minutes, to see if this will give the SQL endpoint sufficient time to do "whatever needs to be done" to refresh the shortcuts/links.
But as far as you know, the SQL endpoint should be always-up-to-date with the underlying data? There is no "reframing" activities going on behind the scenes, where it holds a cache of which parquet files makes up the latest verison of the Delta Lake table?
- AndyDDC2 years agoMost Valuable Professional
There certainly is reframing with power bi datasets in terms of updating metadata to understand which is the latest delta data. But for the SQL Endpoint I am not aware of any reframing process, it should read the latest transaction log and display the latest data. It's also the fact that it works "some of the time" in your scenario that's troubling me.
What's the volume of data?
- FelixL2 years agoAdvocate II
Yes, this is troubling for me to.
Most affected tables are rather small, around 100~ MB in total parquet size and 2~ Mil records.
I can easily reproduce the SQL endpoint delay issue by starting a notebook and performing a spark sql update against a delta lake table (update xxx set yyy = current_timestamp() , and in paralell checking the SQL endpoint with a query (select max(yyy) from xxx).
From the moment my spark update query returns "success" it takes anywhere from a few seconds up to a few minutes until i see my data change in the SQL endpoint (The old timestamp is returned for a number of T-SQL refreshes, until the new timestmap is finally returned).
I would expect to not ever be able to see the old timestamp if i start querying through the SQL endpoint after the spark sql query has finished - but this is not the case.