Forum Discussion

JorgeMarmol's avatar
JorgeMarmol
Regular Visitor
1 year ago
Solved

Table Sync State: Failure after Pipeline execution

Hi all,   I have been facing a strange issue with my SQL Endpoint after my pipeline execution where I get the data from a SQL Server database and my sink is a Delta Table in a Lakehouse. After a fe...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi JorgeMarmol ,

    I think you can try these steps below:

    1. Sometimes, the metadata might be out of sync. You can try refreshing the table metadata in your SQL Endpoint.

     

    2. Since you can read the data with PySpark but not through the SQL Endpoint, there might be an issue with how the data is being indexed or cached. Try running a REFRESH TABLE <table_name> command in your SQL Endpoint.

     

    3. Ensure there are no locks or long-running transactions on the table that might be causing the issue. You can check this by running SHOW TRANSACTIONS or SHOW LOCKS commands.

     

    4. If manually setting the overwrite option didn't work, try updating the table properties to ensure they are correctly configured. You can use the following PySpark command to set the properties:

    spark.sql("ALTER TABLE <table_name> SET TBLPROPERTIES ('delta.autoOptimize.optimizeWrite' = 'true', 'delta.autoOptimize.autoCompact' = 'true')")

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.