Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions packages/cubejs-schema-compiler/src/adapter/CubeStoreQuery.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import moment from 'moment-timezone';
import { parseSqlInterval, getEnv } from '@cubejs-backend/shared';
import { parseSqlInterval } from '@cubejs-backend/shared';
import { BaseQuery } from './BaseQuery';
import { BaseFilter } from './BaseFilter';
import { BaseMeasure } from './BaseMeasure';
Expand Down Expand Up @@ -32,13 +32,6 @@ type RollingWindow = {
};

export class CubeStoreQuery extends BaseQuery {
private readonly cubeStoreRollingWindowJoin: boolean;

public constructor(compilers, options) {
super(compilers, options);
this.cubeStoreRollingWindowJoin = getEnv('cubeStoreRollingWindowJoin');
}

public newFilter(filter) {
return new CubeStoreFilter(this, filter);
}
Expand All @@ -64,16 +57,10 @@ export class CubeStoreQuery extends BaseQuery {
}

public subtractInterval(date: string, interval: string) {
if (this.cubeStoreRollingWindowJoin) {
return super.subtractInterval(date, interval);
}
return `DATE_SUB(${date}, INTERVAL ${this.formatInterval(interval)})`;
}

public addInterval(date: string, interval: string) {
if (this.cubeStoreRollingWindowJoin) {
return super.addInterval(date, interval);
}
return `DATE_ADD(${date}, INTERVAL ${this.formatInterval(interval)})`;
}

Expand Down Expand Up @@ -198,7 +185,7 @@ export class CubeStoreQuery extends BaseQuery {
cumulativeMeasures: Array<[boolean, BaseMeasure]>,
preAggregationForQuery: any
) {
if (this.cubeStoreRollingWindowJoin || !cumulativeMeasures.length) {
if (!cumulativeMeasures.length) {
return super.regularAndTimeSeriesRollupQuery(regularMeasures, multipliedMeasures, cumulativeMeasures, preAggregationForQuery);
}
const cumulativeMeasuresWithoutMultiplied = cumulativeMeasures.map(([_, measure]) => measure);
Expand Down
Loading