Forum Discussion
Fabric Lakehouse SQL Endpoint Automatic Refresh
- Anonymous1 year ago
Hi Bill_J99294 ,
You can create a notebook that connects to the lakehouse corresponding to your SQL endpoint by entering the following command in the cell:
from pyspark.sql import SparkSession # create Spark session spark = SparkSession.builder \ .appName(“Refresh SQL Endpoint Metadata”) \ .getOrCreate() # refresh spark.sql(“REFRESH TABLE salesorders”) print(“Metadata refresh triggered successfully.”)Set up a daily refresh in your notebook settings so that this refresh command is executed every day.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi Bill_J99294 ,
You can create a notebook that connects to the lakehouse corresponding to your SQL endpoint by entering the following command in the cell:
from pyspark.sql import SparkSession
# create Spark session
spark = SparkSession.builder \
.appName(“Refresh SQL Endpoint Metadata”) \
.getOrCreate()
# refresh
spark.sql(“REFRESH TABLE salesorders”)
print(“Metadata refresh triggered successfully.”)
Set up a daily refresh in your notebook settings so that this refresh command is executed every day.
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi,
I have a lakehouse using schema shortcuts and I want to update the whole lakehouse which essentially contains multiple schemas. Is there a command to refresh by schema or the entire lakeouse as per the manual Metadata Sync button?
Regards