Apache Hudi (pronounced “hoodie”) is the next generation streaming data lake platform. Apache Hudi brings core warehouse and database functionality directly to a data lake.
This article assumes that you have mastered the basic knowledge and operation of Hudi. For the knowledge about Hudi not mentioned in this article, you can obtain it from its Official Documentation.
By using Kyuubi, we can run SQL queries towards Hudi which is more convenient, easy to understand, and easy to expand than directly using Spark to manipulate Hudi.
To enable the integration of kyuubi spark sql engine and Hudi through Catalog APIs, you need to:
Referencing the Hudi dependencies
Setting the Spark extension and catalog configurations
The classpath of kyuubi spark sql engine with Hudi supported consists of
kyuubi-spark-sql-engine-1.8.0-SNAPSHOT_2.12.jar, the engine jar deployed with Kyuubi distributions
a copy of spark distribution
hudi-spark<spark.version>-bundle_<scala.version>-<hudi.version>.jar (example: hudi-spark3.2-bundle_2.12-0.11.1.jar), which can be found in the Maven Central
In order to make the Hudi packages visible for the runtime classpath of engines, we can use one of these methods:
Put the Hudi packages into
To activate functionality of Hudi, we can set the following configurations:
Create Table as a example,
CREATE TABLE hudi_cow_nonpcf_tbl ( uuid INT, name STRING, price DOUBLE ) USING HUDI;
Query Data as a example,
SELECT * FROM hudi_cow_nonpcf_tbl WHERE id < 20;
Insert Data as a example,
INSERT INTO hudi_cow_nonpcf_tbl SELECT 1, 'a1', 20;
Update Data as a example,
UPDATE hudi_cow_nonpcf_tbl SET name = 'foo', price = price * 2 WHERE id = 1;
Delete Data as a example,
DELETE FROM hudi_cow_nonpcf_tbl WHERE uuid = 1;