Forum Discussion

Jaganath's avatar
Jaganath
Frequent Visitor
1 year ago
Solved

Unable to create table in lakehouse SQL endpoint

Hi Team, I have a requirement where my delta table resides in the bronze layer of a Lakehouse, and the silver layer is in the warehouse. I have created a stored procedure in the warehouse to perform...
  • nilendraFabric's avatar
    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