Forum Discussion
Why doesn't my onelake table support updates?
- 1 year ago
Hi spartan27244 The SQL endpoints in Microsoft Fabric are read-only when connected to a Lakehouse.
(SQL Endpoints are readonly)
To update data in a Lakehouse table in Microsoft Fabric, you cannot use SQL directly, but you can do it using a notebook (typically PySpark)
Something like this:
df = spark.read.format("delta").load("Tables/your_table")
df_updated = df.withColumn("status",when(col("user_id") == 123, "active").otherwise(col("status")))
df_updated.write.format("delta").mode("overwrite").save("Tables/your_table")
Hi spartan27244 The SQL endpoints in Microsoft Fabric are read-only when connected to a Lakehouse.
(SQL Endpoints are readonly)
To update data in a Lakehouse table in Microsoft Fabric, you cannot use SQL directly, but you can do it using a notebook (typically PySpark)
Something like this:
df = spark.read.format("delta").load("Tables/your_table")
df_updated = df.withColumn("status",when(col("user_id") == 123, "active").otherwise(col("status")))
df_updated.write.format("delta").mode("overwrite").save("Tables/your_table")
- spartan272441 year agoResolver I
Yes I verified you method does work as well as using SQL in a SQL cell block.