完整报错:
Exception in thread "main" org.apache.spark.sql.AnalysisException: The format of the existing table ods_7.user_info is `HiveFileFormat`. It doesn't match the specified format `ParquetDataSourceV2`.
报错原因:
frame3.write
.format("parquet")
.mode(SaveMode.Append)
.saveAsTable("user.user_info")
报错的意思大概是写入格式与hive存储格式不匹配,然后浏览了网上很多解决方法后总结了
无论是你的格式设置为与hive表格式一样也是无法写入的
总结:
写入表时统一指定为 hive,修改后为
frame3.write
.format("hive")
.mode("append")
.saveAsTable("user.user_info")