Apache Paimon (Incubating)#
Apache Paimon(incubating) is a streaming data lake platform that supports high-speed data ingestion, change data tracking and efficient real-time analytics.
Tip
This article assumes that you have mastered the basic knowledge and operation of Apache Paimon (Incubating). For the knowledge about Apache Paimon (Incubating) not mentioned in this article, you can obtain it from its Official Documentation.
By using kyuubi, we can run SQL queries towards Apache Paimon (Incubating) which is more convenient, easy to understand, and easy to expand than directly using spark to manipulate Apache Paimon (Incubating).
Apache Paimon (Incubating) Integration#
To enable the integration of Kyuubi Spark SQL engine and Apache Paimon (Incubating) through Spark DataSource V2 API, you need to:
Referencing the Apache Paimon (Incubating) dependencies
Setting the Spark extension and catalog configurations
Dependencies#
The classpath of Kyuubi Spark SQL engine with Apache Paimon (Incubating) consists of
kyuubi-spark-sql-engine-1.11.0-SNAPSHOT_2.12.jar, the engine jar deployed with a Kyuubi distribution
a copy of Spark distribution
paimon-spark-<version>.jar (example: paimon-spark-3.5-0.8.1.jar), which can be found in the Apache Paimon (Incubating) Supported Engines Spark3
In order to make the Apache Paimon (Incubating) packages visible for the runtime classpath of engines, we can use one of these methods:
Put the Apache Paimon (Incubating) packages into
$SPARK_HOME/jars
directlySet
spark.jars=/path/to/paimon-spark-<version>.jar
Warning
Please mind the compatibility of different Apache Paimon (Incubating) and Spark versions, which can be confirmed on the page of Apache Paimon (Incubating) multi engine support.
Configurations#
To activate functionality of Apache Paimon (Incubating), we can set the following configurations:
spark.sql.catalog.paimon=org.apache.paimon.spark.SparkCatalog
spark.sql.catalog.paimon.warehouse=file:/tmp/paimon
Apache Paimon (Incubating) Operations#
Taking CREATE NAMESPACE
as a example,
CREATE DATABASE paimon.default;
USE paimon.default;
Taking CREATE TABLE
as a example,
create table my_table (
k int,
v string
) tblproperties (
'primary-key' = 'k'
);
Taking SELECT
as a example,
SELECT * FROM my_table;
Taking INSERT
as a example,
INSERT INTO my_table VALUES (1, 'Hi Again'), (3, 'Test');