Repository navigation
fix(core): support fallback keys for ignore-delete option - #462
Merged
Merged
Conversation
The ignore-delete semantics can also be configured through the merge-engine-specific keys first-row.ignore-delete, deduplicate.ignore-delete and partial-update.ignore-delete, but CoreOptions only parsed ignore-delete and kept the default false, so first-row compaction rejected DELETE/UPDATE_BEFORE records from tables configured with first-row.ignore-delete=true. Parse the fallback keys in fixed order when ignore-delete itself is absent, keeping the primary key's precedence. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds support for parsing merge-engine-specific fallback keys for the ignore-delete option so that tables configured with keys like first-row.ignore-delete behave the same as ignore-delete, matching Java behavior and fixing #461.
Changes:
- Update
CoreOptionsparsing to resolveignore-deletefrom fallback keys in a fixed precedence order when the primary key is absent. - Add new
Options::*constants for the fallback keys in public headers and common defs. - Add unit tests covering fallback resolution and first-row merge behavior with
ignore-deleteenabled via fallback.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/paimon/core/utils/primary_key_table_utils_test.cpp |
Adds integration-style test ensuring first-row merge respects ignore-delete when set via the fallback key. |
src/paimon/core/core_options_test.cpp |
Adds unit tests verifying fallback key precedence/order and invalid value rejection. |
src/paimon/core/core_options.cpp |
Implements fallback-key parsing logic for ignore-delete when the primary key is absent. |
src/paimon/common/defs.cpp |
Defines string values for the new fallback option-key constants. |
include/paimon/defs.h |
Exposes new fallback option-key constants with doc comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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: close #461
The
ignore-deletesemantics can also be configured through the merge-engine-specific keysfirst-row.ignore-delete,deduplicate.ignore-deleteandpartial-update.ignore-delete, which aredeclared as fallback keys of
ignore-delete.CoreOptionsonly parsedignore-deleteand kept thedefault
falseotherwise, so a table configured withfirst-row.ignore-delete=truewas read asignore-delete=false. The first-row merge engine then rejected retract records with:This change parses the fallback keys in fixed order (
first-row.ignore-delete,deduplicate.ignore-delete,partial-update.ignore-delete) whenignore-deleteitself is absent,keeping the primary key's precedence when both are present. The fallback key constants follow the
existing
Options::FALLBACK_BLOB_DESCRIPTOR_FIELDpattern.Tests
CoreOptionsTest.TestIgnoreDeleteFallbackKeys— each fallback key resolves, the primary key takesprecedence over a fallback key, fallback keys are checked in fixed order, and an invalid value is
rejected.
PrimaryKeyTableUtilsTest.TestCreateFirstRowMergeFunctionWithIgnoreDelete— a first-row mergefunction built from
first-row.ignore-deleteignores a DELETE record and keeps the first row,identically to one built from
ignore-delete; without either option retract records are stillrejected.
API and Format
include/paimon/defs.hgains three new option-key constants(
Options::FALLBACK_FIRST_ROW_IGNORE_DELETE,Options::FALLBACK_DEDUPLICATE_IGNORE_DELETE,Options::FALLBACK_PARTIAL_UPDATE_IGNORE_DELETE). This is additive; no existing symbol changes andthe storage format and protocol are unaffected.
Documentation
No new feature, so no documentation change. The new constants carry doc comments in
include/paimon/defs.hfollowing the existing fallback-key convention.Generative AI tooling
Generated-by: Claude Code (Claude Fable 5)