Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
How can I register a delta table in metastore as I am getting the following error
Error reading or writing to the Metastore. Among other things the Metastore keeps track of information about Spark tables. While the Metastore doesn't store the information contained in the tables, it contains information for Spark to read and write to those tables. 1. Ensure that the table doesn't already exist if you're attempting to create a table. 2. Ensure that your user account has the correct permissions on the has "Storage Blob Data Contributor" role on the ADLS Gen2 storage account that is storing the Metadata information. 3. Check the logs for this Spark application. Inspect the logs for a clearer indication of which table relation is causing this issue.
if I do this
%%pyspark
from pyspark.sql.types import *
orderSchema = StructType([
StructField("SalesOrderNumber", StringType())
])
some_df = spark.createDataFrame([], schema)
some_df.write.format("delta").mode("overwrite").save("abfss://xxxx@onelake.dfs.fabric.microsoft.com/StagingLakehouse.Lakehouse/Tables/test")
and then
%%sql
INSERT INTO test (SalesOrderNumber)
VALUES ('testString')
I know the alternative solution to the above but I am interested to know do I need to register this table for metastore ( if yes, how?) in order for INSERT to work.
Thank you in advance.
Solved! Go to Solution.
Can be resolved by using tablebuilder api
Can be resolved by using tablebuilder api
What is the default Lakehouse for your Notebook?
I think your lakehouse (it seems your lakehouse is named StagingLakehouse) needs to be the default lakehouse for your notebook in order for the SQL command to identify the table in the Lakehouse.
(Also, just want to ask, is the StagingLakehouse a so-called Dataflows Gen2 Staging Lakehouse (if so, that could maybe cause an issue))
Can you use savetotable in the lakehouse?