File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
cubejs-backend-shared/src Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,9 @@ const variables: Record<string, (...args: any) => any> = {
226226 transpilationWorkerThreads : ( ) => get ( 'CUBEJS_TRANSPILATION_WORKER_THREADS' )
227227 . default ( 'false' )
228228 . asBoolStrict ( ) ,
229+ allowNonStrictDateRangeMatching : ( ) => get ( 'CUBEJS_PRE_AGGREGATIONS_ALLOW_NON_STRICT_DATE_RANGE_MATCH' )
230+ . default ( 'true' )
231+ . asBoolStrict ( ) ,
229232 transpilationWorkerThreadsCount : ( ) => get ( 'CUBEJS_TRANSPILATION_WORKER_THREADS_COUNT' )
230233 . default ( '0' )
231234 . asInt ( ) ,
Original file line number Diff line number Diff line change @@ -246,6 +246,12 @@ export class CubeSymbols {
246246 preAggregation . type = 'rollup' ;
247247 }
248248
249+ if ( preAggregation . allowNonStrictDateRangeMatch === undefined &&
250+ [ 'originalSql' , 'rollupJoin' , 'rollup' ] . includes ( preAggregation . type ) &&
251+ ( preAggregation . timeDimension || preAggregation . timeDimensions ) ) {
252+ preAggregation . allowNonStrictDateRangeMatch = getEnv ( 'allowNonStrictDateRangeMatching' ) ;
253+ }
254+
249255 if ( preAggregation . scheduledRefresh === undefined && preAggregation . type !== 'rollupJoin' && preAggregation . type !== 'rollupLambda' ) {
250256 preAggregation . scheduledRefresh = getEnv ( 'scheduledRefreshDefault' ) ;
251257 }
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ describe('Schema Testing', () => {
6969 refreshRangeEnd : {
7070 sql : expect . any ( Function ) ,
7171 } ,
72+ allowNonStrictDateRangeMatch : true ,
7273 } ,
7374 countCreatedAt : {
7475 external : true ,
@@ -102,6 +103,7 @@ describe('Schema Testing', () => {
102103 refreshRangeEnd : {
103104 sql : expect . any ( Function ) ,
104105 } ,
106+ allowNonStrictDateRangeMatch : true ,
105107 }
106108 } ) ;
107109 } ) ;
@@ -128,6 +130,7 @@ describe('Schema Testing', () => {
128130 refreshRangeEnd : {
129131 sql : expect . any ( Function ) ,
130132 } ,
133+ allowNonStrictDateRangeMatch : true ,
131134 } ,
132135 countCreatedAt : {
133136 // because preview
@@ -162,6 +165,7 @@ describe('Schema Testing', () => {
162165 refreshRangeEnd : {
163166 sql : expect . any ( Function ) ,
164167 } ,
168+ allowNonStrictDateRangeMatch : true ,
165169 }
166170 } ) ;
167171 } ) ;
You can’t perform that action at this time.
0 commit comments