Repository navigation
Backport #130192 to 26.3: Keep the NULL partition in Delta Lake partition pruning when the filter's set holds NULL - #131851
Merged
Conversation
…tition pruning when the filter's set holds `NULL` (cherry picked from commit 0cc79e2)
… can run 26.3's KeyDescription::getKeyFromAST takes no `virtuals` argument (#102827 is not on 26.3), so drop the `{}` the cherry-pick carried. The test built its Delta tables with INSERT INTO FUNCTION deltaLakeLocal under allow_delta_lake_writes. On 26.3 that setting is still called allow_experimental_delta_lake_writes, and a partitioned INSERT of a NULL value fails with NOT_IMPLEMENTED (#111793 is not on 26.3). Write the same tables by hand instead, as 26.3's 05237 test does: Parquet data files through file() and one add action per file, a NULL partition value committed as a JSON null under __HIVE_DEFAULT_PARTITION__. Two cases fail on 26.3 with and without this change, so they are dropped: `ifNull(p, 0) IN (0)` prunes the NULL partition (a MergeTree table partitioned by the same Nullable column returns the same wrong rows on 26.3), and `has([NULL, 'a'], s)` throws CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN (#115647 is not on 26.3). On 26.3 the fix keeps the NULL partition's file for `has([5, 7], p)`, so that case prunes 1 file instead of 2 (rows unchanged): 26.3 builds no set index for a UInt8 array over a Nullable(Int64) key; 26.3's MergeTree partition pruning does not use that predicate on a Nullable key either. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 25da41d)
…prunes no file On 26.3 the Nullable key condition does not prove that this predicate is false for the `NULL` partition, so the partition pruner keeps its file and prunes 0 files instead of 1. The rows are the same; keeping a file is the conservative outcome. Reproduced with the `build_arm_release` binary of this PR (26.3.61.91); the other cases match the reference. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=130717&sha=a3a2d22f6027fc8c95c20735d2a9c17fa472b7a0&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29 PR: #130717 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 715faa4)
Contributor
|
Workflow [BackportPR], commit [f468fb6] Summary: ✅ |
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.
Backport of #130192 to
26.3: keep theNULLpartition in Delta Lake partition pruning when the filter's set holdsNULL.This supersedes #130717. The
26.3branch history was rewritten, so the branch of that PR carries 215 commits that are no longer ancestors of26.3and thecheck_backport_branch.pyhook fails (a backport PR must have at most 50 commits). Fixing that would need a history rewrite of the published branch, so this PR re-applies the same three commits (the robot backport, the 26.3 adaptation bygroeneai, and the test reference adjustment) on top of the current26.3. The resulting diff against26.3is byte-identical to the effective diff of #130717.Related: #130717
Related: #130192
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Keep the
NULLpartition in Delta Lake partition pruning when the filter's set holdsNULL.🤖 Generated with Claude Code
Version info
26.3.65.7