Skip to content

[core] Handle null merge result in first-row changelog wrapper - #10222

Open
LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:m/core-047-firstrow-getresult
Open

LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:m/core-047-firstrow-getresult

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Purpose

With ignore-delete configured, 0.7- tables could persist lone retract records into data files, so a first-row merge group consisting solely of such records leaves FirstRowMergeFunction.getResult() null. FirstRowMergeFunctionWrapper.getResult() then dereferenced that null at contains.test(result.key()), so every compaction of such a key crashed with a NullPointerException.

This returns the empty result before the contains lookup when the merge result is null, matching the existing "nothing to emit" path.

Tests

Added testFirstRowAllRetractRecordsWithIgnoreDelete in LookupChangelogMergeFunctionWrapperTest: with ignore-delete, a merge group of only DELETE records now yields an empty ChangelogResult (null result, no changelog) instead of an NPE.

API and Format

No.

Documentation

No.

With ignore-delete configured, 0.7- tables could persist lone retract
records into data files; a merge group consisting solely of such
records leaves FirstRowMergeFunction.getResult() null, and
FirstRowMergeFunctionWrapper dereferenced it for the contains lookup —
every compaction of such a key crashed with a NullPointerException.

Return the empty result before the lookup when the merge result is
null.

Assisted-by: GLM-5.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant