Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
schou
Frequent Visitor

Table creation in lakehouse with schema

Hello,

 

I had a schema-enforced lakehouse and tried to create a table with Pyspark. Code as below:

df.write.mode("overwrite").option("overwriteSchema", "true").format("delta").saveAsTable("schema.table")
 
But returned the error like this: An error occurred while calling o4724.saveAsTable. : java.lang.RuntimeException: Request failed: HTTP/1.1 403 Forbidden
 
I am able to use the same code to create a table in a non schema lakehouse.
My account have write permission to both lakehouses.
 
Does anyone has insight of it?
 
Thank you!!
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @schou  ,

 

As far as I know this error message occurs due to architectural mismatch occurs .

You can try using the following syntax:

df = spark.read.format(“csv”).option(“header”, “false”).load( “Files/2019.csv")
# Create a new table
df.write.format(“delta”).saveAsTable(“test2”)

If the above syntax doesn't take effect, you may want to consider leaving this message unchecked, as checking it may cause the system to apply more stringent checks to the data being written

 

vyangliumsft_0-1725000842664.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @schou  ,

 

As far as I know this error message occurs due to architectural mismatch occurs .

You can try using the following syntax:

df = spark.read.format(“csv”).option(“header”, “false”).load( “Files/2019.csv")
# Create a new table
df.write.format(“delta”).saveAsTable(“test2”)

If the above syntax doesn't take effect, you may want to consider leaving this message unchecked, as checking it may cause the system to apply more stringent checks to the data being written

 

vyangliumsft_0-1725000842664.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.