Flink is now Scala Free. In the upcoming 1.15 release, Flink will not expose any specific Scala version. Users can now choose whatever Scala version they need in their user code, including Scala 3.
This repository is a reimplementation of Timo Walther's Flink API Examples for DataStream API and Table API examples in Scala 3. You can watch his talk Flink's Table & DataStream API: A Perfect Symbiosis on YouTube which walks through the Java version of this code.
-
Import this repository into your IDE (preferably IntelliJ IDEA). The project uses the latest Flink 1.15 nightly version.
-
All examples are runnable from the IDE or SBT. You simply need to execute the
main()
method of every example class. -
In order to make the examples run within IntelliJ IDEA, it is necessary to tick the
Add dependencies with "provided" scope to classpath
option in the run configuration underModify options
. -
For the Apache Kafka examples, download and unzip Apache Kafka.
-
Start up Kafka and Zookeeper:
./bin/zookeeper-server-start.sh config/zookeeper.properties &
./bin/kafka-server-start.sh config/server.properties &
- Run
FillKafkaWithCustomers
andFillKafkaWithTransactions
to create and fill the Kafka topics with Flink.