Skip to content

Commit db77db7

Browse files
committed
fix(cube): Turn off CubeStore rolling window logic based on joins
1 parent f11fc23 commit db77db7

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

packages/cubejs-schema-compiler/src/adapter/CubeStoreQuery.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import moment from 'moment-timezone';
2-
import { parseSqlInterval, getEnv } from '@cubejs-backend/shared';
2+
import { parseSqlInterval } from '@cubejs-backend/shared';
33
import { BaseQuery } from './BaseQuery';
44
import { BaseFilter } from './BaseFilter';
55
import { BaseMeasure } from './BaseMeasure';
@@ -32,12 +32,6 @@ type RollingWindow = {
3232
};
3333

3434
export 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

Comments
 (0)