Skip to content

Document Table Constraint Enforcement Behavior in Custom Table Providers Guide #16340

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kosiew
Copy link
Contributor

@kosiew kosiew commented Jun 9, 2025

Which issue does this PR close?

Closes #16309

Rationale for this change

Table constraints like primary keys, uniqueness, and foreign keys are common features in relational systems, but DataFusion does not currently enforce or optimize based on most of them. This lack of enforcement isn't clearly documented, which can lead to confusion for TableProvider authors and users expecting standard SQL behavior. This PR aims to clarify that and guide users with expectations and references for typical implementations.

What changes are included in this PR?

  • Adds documentation to the custom-table-providers.md file describing how DataFusion currently treats table constraints.
  • Notes that some constraints (like nullability) are enforced, but others (like uniqueness or PK/FK constraints) are not.
  • References relevant background discussion and highlights the optimizer's current limitations in leveraging constraint metadata.

Are these changes tested?

N/A – This change is purely documentation-related and does not include or require any code or behavior changes.

Are there any user-facing changes?

Yes – this change updates the documentation to make constraint behavior more transparent for users implementing custom TableProviders.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation on constraint enforcements
1 participant