Forum Discussion
Unable to create table in lakehouse SQL endpoint
- 1 year ago
Hello Jaganath
suparnababu8 is absolutely right
You can’t create or alter Lakehouse tables through the Lakehouse SQL endpoint; it’s read-only for T-SQL DDL statements. Even if you’re a workspace admin, table creation there is blocked. Instead, you could:
Use a Warehouse
3. If your goal is to handle staging or temp tables with T-SQL statements, do it in a Warehouse, where T-SQL CREATE TABLE or CREATE TEMPORARY TABLE operations are allowed.
2. Use Spark Notebooks
In a Lakehouse, DDL changes require Spark. For instance:# Create a table in Lakehouse from a notebook
df.write.format("delta").mode("overwrite").saveAsTable("myLakehouseTable")If you need a temporary table specifically to handle SCD logic, move that logic to a Warehouse or keep it in Spark so that creation of the intermediate table is permitted
hope this helps
thanks
Hi Jaganath
I too faced the similar problem in lakehouse. In lakehouse SQL end point will not allow to create new tables in Lakehouse. It can be used for onyl querying the data.
Insted of using SQL you can try to create a new table with notebooks by using PySpark or SparkSQL. I tried in the same way it works for me.
You can go through the below blog, It'll help you to solve your issue.
Let me kknow if it works.
Thanks