-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The Open Data Contract Standard (ODCS) has gained significant momentum for defining schemas, data quality assertions, and service-level agreements. However, the tooling landscape surrounding ODCS is heavily biased toward the Python ecosystem.
odcs-java-sdk is built to solve this JVM gap.
It provides a native, high-performance Java library that handles ODCS contract parsing, spec validation, version migration, and active runtime enforcement. Instead of relying on external process wrappers, data engineers can use a lightweight, zero-overhead Java library to enforce data contracts directly inside Spark jobs, Kafka event streams, and JVM services.
The foundational engine with zero heavy runtime dependencies.
- Parsers and Writers: Reads and outputs ODCS v3 specs in both YAML and JSON.
- Spec Validator: Checks contracts against official JSON schemas and structural invariants.
- Fluent Builder API: Provides a clean, type-safe Java builder to construct contracts programmatically.
- Version Migration Engine: Uses a strategy pattern to upgrade older contracts (e.g., v2.x to v3.x) while generating audit logs for applied defaults and deprecated fields.
Plugs directly into Apache Spark pipelines across Java, Scala, and PySpark environments.
- Distributed Rule Execution: Compiles ODCS quality rules directly into native Spark SQL expressions (Dataset) that run in parallel across worker nodes.
- Row-Level Quarantine (DLQ): Evaluates records row-by-row, splitting DataFrames into valid records and quarantined records (routed to a DLQ storage location with violation metadata).
- Write Guardrails: Blocks bad writes before they hit Delta Lake, Apache Iceberg, or Apache Hudi production tables.
Removes the friction of manual contract creation by translating existing metadata formats into valid ODCS v3 definitions.
- Supported Formats: Apache Avro (.avsc), Protocol Buffers (.proto), JSON Schema, dbt schema.yml, and ANSI/PostgreSQL DDL.
A streaming enforcement module for event-driven architectures.
- Interceptors and SerDe: Validates record payloads against ODCS specs before serialization on Kafka brokers.
- Dead Letter Topics (DLT): Automatically routes non-compliant messages to a DLT with attached violation reasons.
Bridges contract runtime state back into governance and observability platforms.
- Catalog Sync: Pushes ODCS contracts and execution status into OpenMetadata, DataHub, and Atlan.
- OpenTelemetry Exporter: Emits validation metrics (odcs.validation.passed_rows, odcs.validation.failed_rows) to Prometheus, Grafana, or Datadog.
| Module | Status | Primary Scope / Capabilities |
|---|---|---|
| odcs-core | 🟢 Released (0.1.x) | Core POJOs, YAML/JSON parser and writer, spec validator, fluent builder API, and version migration engine. |
| odcs-spark | In Active Development | Distributed Spark SQL rule compiler, DataFrame validation, write guardrails, and row-level DLQ quarantine routing. |
| odcs-converters | Planned (Phase 2) | Automated schema conversion from Avro, Protobuf, JSON Schema, dbt models, and SQL DDL into ODCS specs. |
| odcs-kafka | Planned (Phase 3) | Streaming SerDe validation, record interceptors, and automated Dead-Letter Topic (DLT) routing. |
| odcs-catalog-connectors | Planned (Phase 3) | Catalog sync with OpenMetadata, DataHub, Atlan, and OpenTelemetry (OTel) metric reporting. |