繁体   English   中英

可以使用 Apache Hudi 将一行从 Apache Spark dataframe 插入 Postgres 数据库吗?

[英]Can Apache Hudi be used to upsert a row from Apache Spark dataframe into Postgres database?

问题陈述:Apache Spark 中没有对数据库的更新插入功能,而是我们必须覆盖整个表。 但是 Apache Hudi 可用于在不覆盖整个表的情况下向表中插入一行或多行。

我了解 Apache Hudi 是可以与 S3 一起使用的表/文件格式。 但它也可以与 Postgresdb 或 MySql 或 Oracledb 一起使用吗?

Hudi 在 HCFS(Hadoop Compatible File System)上管理数据集的存储层,答案是否定的,Hudi 无法管理 Postgresdb、MySql 和 Oracledb 表,因为它们不是 HCFS,而且永远不会。

Instead, and where the jdbc DataFrameWriter can only append to existing table or overwrite it, you can use foreach or foreachPartition to call a function which create a jdbc connection (based on the language you want to use), and upsert the data in the table .

暂无
暂无

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

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