Synapse Serverless SQL external table returns old data

Nelia Steenkamp 0 Reputation points
2024-09-27T11:01:11.09+00:00

An external table created in a Synapse Serverless SQL pool for an Azure Storage account Delta Table is not showing the data as it is in the Delta table.

 

When the external table was initially created the data in the table was incorrect. The decision was made to drop and recreate the Delta Table in the Azure Storage Account. Please take note that the structure of the table was not changed, just the data.

 

When the external table is queried the data that is returned is still the old incorrect data. However, when the data is queried from Azure Databricks the data is correct. Also, when queried from Synapse Serverless SQL using OPENROWSET the data is correct.

 

The external table was dropped and recreated, but the data returned remains the old incorrect data. Also, the Delta Table Optimize and Vacuum functions have been run.

Any guidance would be appreciated.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,936 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Smaran Thoomu 16,230 Reputation points Microsoft Vendor
    2024-09-27T21:56:15.6466667+00:00

    Hi @Nelia Steenkamp
    Greetings & Welcome to Microsoft Q&A forum! 
    Thanks for providing such a detailed explanation of the issue you're facing with the Synapse Serverless SQL external table. From what you've described, it seems the problem might be linked to caching or metadata inconsistencies.

    Here are a few things you could try:

    1. Manual Refresh: After dropping and recreating the Delta table, make sure you've manually refreshed the external table to trigger a re-scan of the data.
    2. Check Cache Settings: See if query caching is enabled for the external table. Try disabling it temporarily to see if that resolves the issue.
    3. Data Source Configuration: Double-check the location and credentials in the external table definition to ensure they match the correct Azure Storage account and Delta table.

    Delta Table Metadata: You might also want to run Delta Lake's OPTIMIZE and VACUUM commands again to ensure data integrity and fix any potential metadata issues.

    If these steps don’t resolve the issue, feel free to share more details about your Synapse Serverless SQL pool configuration, the external table definition, and any error messages you're seeing.

    Hope this helps! Let me know if you have any further questions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.