Repository navigation
[lake/paimon] Validate primary-key imports and bucket keys - #5403
Merged
Merged
Conversation
Reject primary-key imports with unsupported merge engines, row TTL or tagged KV layouts before creating database or table metadata. Compare resolved ordered Paimon bucket keys as physical schema metadata so implicit and equivalent explicit defaults are compatible. Preserve immutable option and legacy schema checks. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-6 AI-Contributed/Feature: 106/106 AI-Contributed/UT: 597/597
beryllw
reviewed
Nov 27, 2026
beryllw
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks for the fix!
| throw new TableAlreadyExistException("Table " + tablePath + " already exists."); | ||
| } | ||
|
|
||
| validateBulkLoadSupport(tablePath, tableDescriptor); |
Contributor
There was a problem hiding this comment.
Could we run this check only when the source table has a snapshot? Tables without a snapshot skip BulkLoad, and this check now prevents some of those tables from being enabled.
Contributor
Author
There was a problem hiding this comment.
I’d prefer to keep this validation unconditional, so the supported configurations for createTableFromLake don’t depend on the source’s current snapshot state. This intentionally excludes some existing empty tables. For new empty tables, users can create them through Fluss and let Fluss create the Paimon table.
beryllw
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: Part of #4846.
Reject Paimon primary-key imports whose merge engines or KV value layouts cannot be built by BulkLoad, before creating Fluss database/table metadata. Accept equivalent implicit and explicit Paimon bucket keys when enabling lake access; previously a source without
bucket-keycould be rejected against the generatedbucket-key=idschema.This is an independently reviewable prerequisite extracted from #5400, based on
main.Brief change log
TableSchema.bucketKeys()alongside primary and partition keys. Keep immutable-option validation and legacy-layout compatibility without rewriting source options.Tests
CreateTableFromLakeITCasevariants, 37PaimonLakeCatalogTestschema/alter variants, and 9EnableFlussOnLakeTableProcedureITCasevariants.API and Format
createTableFromLakenow rejects unsupported primary-key configurations before creating metadata. Internal compatibility methods accept PaimonTableSchemaobjects. No public SDK signatures, RPC messages or persisted formats change.Documentation
No new feature or configuration. The code comment explains why resolved bucket keys are checked as schema metadata instead of comparing raw option values.