11import moment from 'moment-timezone' ;
2- import { parseSqlInterval , getEnv } from '@cubejs-backend/shared' ;
2+ import { parseSqlInterval } from '@cubejs-backend/shared' ;
33import { BaseQuery } from './BaseQuery' ;
44import { BaseFilter } from './BaseFilter' ;
55import { BaseMeasure } from './BaseMeasure' ;
@@ -32,12 +32,6 @@ type RollingWindow = {
3232} ;
3333
3434export class CubeStoreQuery extends BaseQuery {
35- private readonly cubeStoreRollingWindowJoin : boolean ;
36-
37- public constructor ( compilers , options ) {
38- super ( compilers , options ) ;
39- this . cubeStoreRollingWindowJoin = getEnv ( 'cubeStoreRollingWindowJoin' ) ;
40- }
4135
4236 public newFilter ( filter ) {
4337 return new CubeStoreFilter ( this , filter ) ;
@@ -64,16 +58,10 @@ export class CubeStoreQuery extends BaseQuery {
6458 }
6559
6660 public subtractInterval ( date : string , interval : string ) {
67- if ( this . cubeStoreRollingWindowJoin ) {
68- return super . subtractInterval ( date , interval ) ;
69- }
7061 return `DATE_SUB(${ date } , INTERVAL ${ this . formatInterval ( interval ) } )` ;
7162 }
7263
7364 public addInterval ( date : string , interval : string ) {
74- if ( this . cubeStoreRollingWindowJoin ) {
75- return super . addInterval ( date , interval ) ;
76- }
7765 return `DATE_ADD(${ date } , INTERVAL ${ this . formatInterval ( interval ) } )` ;
7866 }
7967
@@ -198,7 +186,7 @@ export class CubeStoreQuery extends BaseQuery {
198186 cumulativeMeasures : Array < [ boolean , BaseMeasure ] > ,
199187 preAggregationForQuery : any
200188 ) {
201- if ( this . cubeStoreRollingWindowJoin || ! cumulativeMeasures . length ) {
189+ if ( ! cumulativeMeasures . length ) {
202190 return super . regularAndTimeSeriesRollupQuery ( regularMeasures , multipliedMeasures , cumulativeMeasures , preAggregationForQuery ) ;
203191 }
204192 const cumulativeMeasuresWithoutMultiplied = cumulativeMeasures . map ( ( [ _ , measure ] ) => measure ) ;
0 commit comments