Forum Discussion

marcosvin's avatar
marcosvin
Resolver II
9 months ago
Solved

Error creating external table with lakehouse schema enabled

Hello!

 

When I try to run the command to create a table of type "EXTERNAL" in a Lakehouse, I receive an error message.

 

Command: 

 

df.write.format("delta").saveAsTable("external_products", path="abfs_path/external_products")

 

Error message:

 

Py4JJavaError: An error occurred while calling o7986.saveAsTable.
: java.lang.AssertionError: assertion failed: Only the following table types are supported: MANAGED, MATERIALIZED_LAKE_VIEW, VIEW

 

Note: This error only occurs when I use a Lakehouse with the "Lakehouse schemas" option enabled.

Do you know what it could be?

 

  • Hi marcosvin

     

    This is a known limitation. 

    When schemas are enabled on a Lakehouse, Spark is restricted to creating only MANAGED tables (plus lake views).

     

    See Microsoft’s overview and preview notes for Lakehouse schemas and related discussions: Lakehouse schemas (Preview), and see this other community thread that comes to the same conclusion.


    If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

1 Reply

  • Hi marcosvin

     

    This is a known limitation. 

    When schemas are enabled on a Lakehouse, Spark is restricted to creating only MANAGED tables (plus lake views).

     

    See Microsoft’s overview and preview notes for Lakehouse schemas and related discussions: Lakehouse schemas (Preview), and see this other community thread that comes to the same conclusion.


    If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.