Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schematron): add java capabilities for schema translation #11963

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

shirshanka
Copy link
Contributor

@shirshanka shirshanka commented Nov 26, 2024

This PR

Introduces SchemaTron, an incubating toolkit for translating between different schema formats and DataHub's native schema representation. This PR focuses on Avro schema support with a CLI and a lib module.

Takes a first shot at addressing issue #11947

Key Features

  • Robust Avro schema translation supporting complex types (unions, arrays, maps, nested records)
  • CLI tool for direct schema conversion and DataHub integration
  • Field path generation following SchemaFieldPath V2 spec
  • Handles nullable fields, defaults, and logical types

Testing

  • Unit tests for field path handling and core translation logic
  • Cross-implementation validation against Python reference
  • Example schemas covering common data modeling patterns

Next Steps

  • Additional schema format support beyond Avro
  • Enhanced documentation and integration guides
  • Performance optimization for large schemas

The implementation follows DataHub conventions and is marked as incubating to gather community feedback before finalizing the APIs.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Nov 26, 2024
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Nov 26, 2024
@david-leifker
Copy link
Collaborator

re-running the test 1 time

implementation project(':entity-registry')
//
// // Jackson dependencies - use the same versions as in the parent project
// implementation 'com.fasterxml.jackson.core:jackson-core:2.12.3'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we clean these guys up?

import com.linkedin.schema.SchemaMetadata;

/** Base interface for converting between different schema formats. */
public interface SchemaConverter<T> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@david-leifker david-leifker merged commit f9cc67d into datahub-project:master Nov 26, 2024
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata needs-review Label for PRs that need review from a maintainer. release-0.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants