简体   繁体   English

数据块 - overwriteSchema

[英]Databricks - overwriteSchema

Multiple times I've had an issue while updating a delta table in Databricks where overwriting the Schema fails the first time, but is then successful the second time.在更新 Databricks 中的增量表时,我多次遇到问题,第一次覆盖架构失败,但第二次成功。 The solution to my problem was to simply run it again, and I'm unable to reproduce at this time.我的问题的解决方案是简单地再次运行它,此时我无法重现。 If it happens again I'll come back and post the exact error message, but it was in essence a Schema Mismatch error.如果它再次发生,我会回来发布确切的错误消息,但它本质上是一个架构不匹配错误。 Has anyone else had a similar problem?还有其他人遇到过类似的问题吗?

overwriteSchema = True
DF.write \
.format("delta") \
.mode("overwrite") \
.option("overwriteSchema", overwriteSchema) \
.partitionBy(datefield) \
.saveAsTable(deltatable)

Key-value should be string , not Boolean .键值应该是string ,而不是Boolean .option("overwriteSchema", "True")

DF.write \
.format("delta") \
.mode("overwrite") \
.option("overwriteSchema", "True") \
.partitionBy(datefield) \
.saveAsTable(deltatable)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM