Thanks for the question and using MS Q&A platform.
It's great to hear that you're working with Azure Synapse Link to expose Dynamics 365 FO tables to the data lake and using Python and DuckDB to query the data lake parquet files. I'll do my best to help you understand how Synapse SQL is querying the data and why it seems inconsistent.
When you use Azure Synapse Link to expose Dynamics 365 FO tables to the data lake, it creates a set of delta lake tables in the data lake. These delta lake tables are used to store the incremental changes to the data in Dynamics 365 FO. The delta lake tables are organized into a folder structure that represents the table hierarchy in Dynamics 365 FO.
When you query the delta lake tables using Synapse SQL, it uses the Apache Spark engine to read the delta lake files and return the results. The Spark engine uses a technique called predicate pushdown to optimize the query performance. Predicate pushdown is a technique where the filter conditions in the SQL query are pushed down to the data lake files, so only the relevant data is read from the files.
Regarding the issue you mentioned about deleted records not showing up in the delta lake tables, it's possible that the delta lake tables are not being updated correctly. One possible reason for this could be that the delta lake tables are not being refreshed frequently enough. Another reason could be that the delta lake tables are not being updated correctly when records are deleted in Dynamics 365 FO.
To troubleshoot this issue, you can try to manually refresh the delta lake tables and see if the deleted records show up. You can also check the logs for the Azure Synapse Link to see if there are any errors or warnings related to the delta lake tables.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.