This project demonstrates how to use the Databricks Zerobus SDK to ingest records into a Unity Catalog table using Java.
- Java 17 or higher
- Maven
- Databricks Unity Catalog workspace
- Personal Access Token (PAT) for Databricks
src/main/java/org/example/Main.java: Main application logic for ingesting records.src/main/java/org/example/TestTableeOuterClass.java: Generated class from the protobuf definition.test_tablee.proto: Protobuf schema for the table records.jar/databricks_zerobus-0.0.6_fat.jar: Zerobus SDK jar (fat jar).scripts/: Scripts for generating protobuf classes.pom.xml: Maven configuration.
- Clone the repository
- Generate Java classes from proto:
- Run
scripts/build_proto.shor usegenerate_proto.pyto generateTestTableeOuterClass.javafromtest_tablee.proto.
- Run
- Configure credentials:
- Update
Main.javawith your Databricks workspace ID, workspace URL, and PAT.
- Update
- Build the project:
- Run
mvn clean package
- Run
mvn exec:java -Dexec.mainClass="org.example.Main"
- The Zerobus SDK jar is referenced in
pom.xmlusing thesystemscope. Ensure the jar exists atjar/databricks_zerobus-0.0.6_fat.jar. - The application ingests 100,000 records into the specified Unity Catalog table.
This project is for demonstration purposes only.