Flink-Ignite Custom Dialect
This project draws inspiration from this Medium article:
Enhancing Real-Time Analytics with Apache Ignite and Flink SQL
A custom Apache Flink JDBC dialect implementation for Apache Ignite, enabling seamless integration between Flink and Ignite via the JDBC connector. This dialect allows Flink to read from and write to Apache Ignite tables using SQL and the Table API.
Features#
- Custom
JdbcDialect
for Apache Ignite - Supports upsert (MERGE) statements for idempotent writes
- Compatible with Flink Table & SQL API
- Auto-discovery via Java SPI (no manual registration required)
- Supports a wide range of SQL types
Requirements#
- Java 8+
- Apache Maven
- Apache Flink 1.16.1
- Apache Ignite 2.15.0
Build Instructions#
- Clone this repository:
- Build the JAR using Maven:
The resulting JAR will be in
target/flink-ignite-dialect-1.0.0.jar
.
Usage#
- Add the JAR to Flink:
- Copy
flink-ignite-dialect-1.0.0.jar
to thelib/
directory of your Flink distribution or add it to your job’s classpath. - Ensure Ignite JDBC Driver is available:
- The dialect uses
org.apache.ignite.IgniteJdbcThinDriver
. Make sure the Ignite JDBC driver JAR is also present in the Flinklib/
directory. - Define a Flink Table with Ignite: Example Flink SQL DDL:
-
Replace
<ignite-host>
andmy_table
with your Ignite node and table name. -
Use in Flink SQL or Table API:
- You can now read from and write to Ignite tables using Flink SQL or the Table API.
Configuration Options#
Common connector options (see Flink JDBC connector docs):
'connector' = 'jdbc'
'url' = 'jdbc:ignite:thin://<ignite-host>:10800'
'table-name' = '<ignite-table>'
'driver' = 'org.apache.ignite.IgniteJdbcThinDriver'
'username'
/'password'
(if authentication is enabled)'sink.buffer-flush.max-rows'
,'sink.buffer-flush.interval'
, etc.
How It Works#
- The dialect is auto-registered via the Java Service Provider Interface (SPI) using the file:
src/main/resources/META-INF/services/org.apache.flink.connector.jdbc.dialect.JdbcDialectFactory
- Flink will automatically use this dialect for any JDBC URL starting with
jdbc:ignite:thin:
.