Skip to content

feat(core-spec): make relationship cardinality explicit - #794

Open
christianeu-db wants to merge 1 commit into
apache:mainfrom
christianeu-db:relationship-cardinality
Open

christianeu-db wants to merge 1 commit into
apache:mainfrom
christianeu-db:relationship-cardinality

Conversation

@christianeu-db

@christianeu-db christianeu-db commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A relationship may declare cardinality: ManyToOne, OneToMany, or OneToOne, stated from from to to. An absent value means ManyToOne, so existing documents keep their meaning. There is no many-to-many value.

Layer 2 semantics are unchanged; its mapping text now maps cardinality. Layer 3 paths follow every step that does not increase granularity: from from to to for ManyToOne and OneToOne, and from to to from for OneToMany and OneToOne. Filter propagation stays out of scope.

The validator checks key coverage on each one side of the cardinality. The schema, spec.yaml, the spec type generator, and the Python SDK gain the Cardinality enum.

Discussion: https://lists.apache.org/thread/1kggjhy5tjqjyvlf6rsvs9ygxt6x9zkr

Related Issues

#50

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have a [DISCUSS] thread on dev@ with a stated end date, and reach lazy consensus (or pass a [VOTE]) before merge
  • Breaking changes to the spec are clearly called out in the summary - n/a
  • For a material spec change, docs/spec_changes.md records rationale, compatibility and migration impact, or the PR explains why no entry is needed

Validation

  • Validation rules in validation/ are updated if the spec changed
  • New validation cases are covered by tests

Documentation

  • docs/ is updated to reflect any user-facing changes
  • New features or behaviors are documented with examples where appropriate

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • New third-party dependencies follow Third-Party Dependencies
  • If third-party source code is vendored/copied (not just declared as a dependency), NOTICE and/or LICENSE have been updated per ASF policy

A relationship may declare `cardinality`: ManyToOne, OneToMany, or
OneToOne, stated from `from` to `to`. An absent value means ManyToOne, so
existing documents keep their meaning. There is no many-to-many value.

Layer 2 semantics are unchanged; its mapping text now maps `cardinality`.
Layer 3 paths follow every step that does not increase granularity: from
`from` to `to` for ManyToOne and OneToOne, and from `to` to `from` for
OneToMany and OneToOne. Filter propagation stays out of scope.

The validator checks key coverage on each one side of the cardinality.
The schema, spec.yaml, the spec type generator, and the Python SDK gain
the Cardinality enum.

Discussion: https://lists.apache.org/thread/1kggjhy5tjqjyvlf6rsvs9ygxt6x9zkr

Co-authored-by: Isaac <no-reply@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant