Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
I cannot overwrite table schema using spark.write.mode("overwrite")
For example, create a table with 2 column: col1 as int and col2 as string
Then change col1 to data type int and use spark.write.mode("overwrite")
It return error
Solved! Go to Solution.
I think if you want to overwrite the schema while overwriting the data, you could write like this:
df\
.write\
.mode("overwrite")\
.option("overwriteSchema", "true")\
.saveAsTable("tableName")
So I think you only need to add .option("overwriteSchema", "true") in your code
I think if you want to overwrite the schema while overwriting the data, you could write like this:
df\
.write\
.mode("overwrite")\
.option("overwriteSchema", "true")\
.saveAsTable("tableName")
So I think you only need to add .option("overwriteSchema", "true") in your code
I tried and successed. Thank you very much.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.
User | Count |
---|---|
67 | |
38 | |
15 | |
14 | |
5 |
User | Count |
---|---|
72 | |
65 | |
25 | |
8 | |
7 |