fix: Exclude out-of-range rollupLambda partitions - #11446
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
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.
Summary
A
rollupLambdaquery can treat the last member's most-recent partition as valid even when that member's build range has no overlap with the requested date range.Extend the rollup-lambda result filter in
PreAggregationPartitionRangeLoader.loadPreAggregations()so a candidate with apartitionRangeis retained only when that range intersectsmatchedTimeDimensionDateRange, while preserving current behavior when no matched query range is supplied. Keep the existinglastRollupLambdacompleteness exception and prior-member boundary ordering intact for genuinely overlapping partitions; removing that exception alone does not reject a fully built but irrelevant placeholder. When every candidate is out of range, reuse the existingemptyResultpath so Cube still exposes a structurally compatible table expression guarded byWHERE 1 = 0rather than unioning the placeholder as data. Add direct loader regression coverage using the existing mocks inPreAggregations.test.ts, without introducing a helper or seam used only by tests.Why this matters
A
rollupLambdaquery can treat the last member's most-recent partition as valid even when that member's build range has no overlap with the requested date range.partitionRanges()deliberately supplies that partition as a structural placeholder, butloadPreAggregations()currently filters only for build completeness and ordering against earlier lambda members. BecauselastRollupLambdabypasses the completeness half of that predicate, the irrelevant placeholder can enter the union and contribute to silent empty or incomplete results when another member is stale. The issue is reproducible across partition granularities and database drivers, and a maintainer has confirmed the loader-level root cause.Testing
rollupLambdamember whose placeholder partition is wholly after the requested batch-only range is rejected, and its returned target expression is guarded byWHERE 1 = 0rather than treated as a valid union contributor.matchedTimeDimensionDateRangepreserves the existing lambda filtering behavior instead of treating the absent range as non-overlap.Check List
Fixes #11317