ClickHouse/clickhouse-java#1227
WARN
You must re-assembly the jar after modifying any source code.
In other words, repeat the steps 5, 6, 7.
-
Install spark 2.4.5 locally and set $SPARK_HOME
-
Install JDK8, scala 2.11 and sbt
-
Start clickhouse, zookeeper and kafka:
docker compose up -d
-
Initialize clickhouse database and table in clickhouse pod
create database if not exists test; drop table if exists test.test; create table if not exists test.test ( topic String, offset Int64, value String ) Engine = MergeTree() ORDER BY (topic, offset);
-
Build assembly jar:
sbt assembly
-
Start spark app
$SPARK_HOME/bin/spark-submit --master local \ --deploy-mode client \ --class com.github.oliverdding.spark.test.jobs.OfficialClickHouseJdbcLocal \ --name run \ ./target/scala-2.11/test.jar
-
Generate message in kafka pod
kafka-topics --create --topic test --bootstrap-server localhost:9092 kafka-console-producer --topic test --bootstrap-server localhost:9092