[core] Do not drop partitions when the system-table partition filter cannot be parsed - #10207
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
System tables like t$buckets render the partition as a single string column and parse the pushed-down equality literal back into a partition spec. A partition value that contains the ", " separator (or braces) does not round-trip this format: the parse saw a token count different from the partition key count and the equality branch reported "no partition matches", so a query filtering for that very partition silently returned zero rows from t$buckets, t$files, t$fileindexes and t$filekeyranges. The IN branch had the same flaw per literal: it dropped only the unparseable literals from the pushed filter, silently vanishing their partitions from the results. Treat an unparseable spec like the range branch already does: skip the partition pushdown and read all partitions, letting the engine re-apply the predicate — for equality always, and for IN as soon as any literal fails to parse. The existing test that encoded the old empty-result behavior for a partial key filter is updated to the conservative expectation. Assisted-by: GLM-5.3
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
System tables (
t$buckets,t$files,t$fileindexes,t$filekeyranges) render the partition as a single string column and parse a pushed-down equality or IN literal back into a partition spec before pushing it into the snapshot reader. A partition value that contains the", "separator does not round-trip this format:parsePartitionSpecsees a token count that differs from the number of partition keys and returns null. In that case the Equal branch returned false, which the callers translate into an empty result, so a query filtering for that exact partition silently returned zero rows. The IN branch had the same flaw per literal: it dropped only the unparseable literals from the pushed filter, so their partitions silently vanished from the results.This treats an unparseable spec the way the range branch already does: skip the partition pushdown and read all partitions, letting the engine re-apply the predicate. For Equal it skips the pushdown when the spec is null; for IN it skips the whole pushdown as soon as any literal fails to parse.
Tests
BucketsTableTest.testBucketsTableWithUnparseablePartitionFilterIsConservativepins that an unparseable equality filter degrades to reading all partitions instead of returning empty.BucketsTableTest.testBucketsTableWithPartiallyUnparseableInFilterIsConservativepins that a single unparseable IN literal disables the whole pushdown rather than dropping only that literal's partition.FilesTableTest.testReadWithNotFullPartitionKeyis updated from the old empty-result expectation to the conservative all-partitions expectation.API and Format
No.
Documentation
No.