@@ -688,10 +688,39 @@ export class RefreshScheduler {
688688 if ( queryingOptions . dateRange ) {
689689 preAggregations . forEach ( preAggregation => {
690690 preAggregation . partitions = preAggregation . partitions
691- . filter ( p => PreAggregationPartitionRangeLoader . intersectDateRanges (
692- [ p . buildRangeStart , p . buildRangeEnd ] ,
693- queryingOptions . dateRange ,
694- ) ) ;
691+ . filter ( p => {
692+ if ( ! p . buildRangeStart && ! p . buildRangeEnd ) {
693+ return true ; // If there is no range specified - we should include it like rebuild in anyway
694+ }
695+
696+ return PreAggregationPartitionRangeLoader . intersectDateRanges (
697+ [ p . buildRangeStart , p . buildRangeEnd ] ,
698+ queryingOptions . dateRange ,
699+ ) ;
700+ } ) ;
701+ preAggregation . partitionsWithDependencies . forEach ( pd => {
702+ pd . partitions = pd . partitions . filter ( p => {
703+ if ( ! p . buildRangeStart && ! p . buildRangeEnd ) {
704+ return true ; // If there is no range specified - we should include it like rebuild in any way
705+ }
706+
707+ return PreAggregationPartitionRangeLoader . intersectDateRanges (
708+ [ p . buildRangeStart , p . buildRangeEnd ] ,
709+ queryingOptions . dateRange ,
710+ ) ;
711+ } ) ;
712+
713+ pd . dependencies = pd . dependencies . filter ( p => {
714+ if ( ! p . buildRangeStart && ! p . buildRangeEnd ) {
715+ return true ; // If there is no range specified - we should include it like rebuild in any way
716+ }
717+
718+ return PreAggregationPartitionRangeLoader . intersectDateRanges (
719+ [ p . buildRangeStart , p . buildRangeEnd ] ,
720+ queryingOptions . dateRange ,
721+ ) ;
722+ } ) ;
723+ } ) ;
695724 } ) ;
696725 }
697726
0 commit comments