Repository navigation
API: Handle null partition values in startsWith residuals - #18414
Open
LuciferYang wants to merge 3 commits into
Open
LuciferYang wants to merge 3 commits into
LuciferYang wants to merge 3 commits into
Conversation
ResidualVisitor.startsWith and notStartsWith dereferenced the partition value without a null check, so computing a residual for a null partition threw NullPointerException. This breaks deleteFromRowFilter(startsWith) when a manifest also holds a null partition, and scan tasks for filters such as or(isNull(s), startsWith(s, "a")). Mirror the in/notIn null handling.
This branch has not been deployed
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.
Closes #18412.
ResidualVisitor.startsWithandnotStartsWithcallstartsWithon the partition value without a null check, so the residual for a null partition throwsNullPointerException.ManifestFilterManagercomputes a residual for each live file in a manifest it rewrites, sodeleteFromRowFilter(startsWith("s", "a"))on anidentity(s)table fails whenever that manifest also holds a file with a null partition value. Scans hit it with filters likeor(isNull(s), startsWith(s, "a")): the null-partition task survives planning throughisNull, andFileScanTask.residual()throws.This returns
alwaysFalseforstartsWithandalwaysTruefornotStartsWithwhen the value is null, the same asin/notIn(#17014) and the row-levelEvaluator. One consequence:deleteFromRowFilter(notStartsWith("s", "a"))now deletes null-partition files instead of failing, which is whatnotEqualandnotInalready do.New tests:
TestResiduals: null partition forstartsWithandnotStartsWith, and theor(isNull, startsWith)shape.TestTruncatesResiduals: null partition undertruncate.TestDeleteFiles.testDeleteByStartsWithKeepsNullPartition: the delete above keeps the null-partition file.AI Disclosure