Flink Table Store
Contents
Flink Table Store#
Flink Table Store is a unified storage to build dynamic tables for both streaming and batch processing in Flink, supporting high-speed data ingestion and timely data query.
Tip
This article assumes that you have mastered the basic knowledge and operation of Flink Table Store. For the knowledge about Flink Table Store not mentioned in this article, you can obtain it from its Official Documentation.
By using kyuubi, we can run SQL queries towards Flink Table Store which is more convenient, easy to understand, and easy to expand than directly using trino to manipulate Flink Table Store.
Flink Table Store Integration#
To enable the integration of kyuubi trino sql engine and Flink Table Store, you need to:
Referencing the Flink Table Store dependencies
Setting the trino extension and catalog configurations
Dependencies#
The classpath of kyuubi trino sql engine with Flink Table Store supported consists of
kyuubi-trino-sql-engine-1.6.1-incubating_2.12.jar, the engine jar deployed with Kyuubi distributions
a copy of trino distribution
flink-table-store-trino-<version>.jar (example: flink-table-store-trino-0.2.jar), which code can be found in the Source Code
flink-shaded-hadoop-2-uber-2.8.3-10.0.jar, which code can be found in the Pre-bundled Hadoop 2.8.3
In order to make the Flink Table Store packages visible for the runtime classpath of engines, we can use these methods:
Build the flink-table-store-trino-<version>.jar by reference to Flink Table Store Trino README
Put the flink-table-store-trino-<version>.jar and flink-shaded-hadoop-2-uber-2.8.3-10.0.jar packages into
$TRINO_SERVER_HOME/plugin/tablestore
directly
Warning
Please mind the compatibility of different Flink Table Store and Trino versions, which can be confirmed on the page of Flink Table Store multi engine support.
Configurations#
To activate functionality of Flink Table Store, we can set the following configurations:
Catalogs are registered by creating a catalog properties file in the $TRINO_SERVER_HOME/etc/catalog directory. For example, create $TRINO_SERVER_HOME/etc/catalog/tablestore.properties with the following contents to mount the tablestore connector as the tablestore catalog:
connector.name=tablestore
warehouse=file:///tmp/warehouse
Flink Table Store Operations#
Flink Table Store supports reading table store tables through Trino.
A common scenario is to write data with Flink and read data with Trino.
You can follow this document Flink Table Store Quick Start to write data to a table store table
and then use kyuubi trino sql engine to query the table with the following SQL SELECT
statement.
SELECT * FROM tablestore.default.t1