Skip to content

Commit 963c96c

Browse files
committed
fix
1 parent a8476d9 commit 963c96c

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

packages/cubejs-schema-compiler/src/compiler/CubeSymbols.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ export class CubeSymbols {
642642
try {
643643
const deps: any[] = [];
644644
this.resolveSymbolsCall(sql, (name) => {
645-
deps.push({ name, undefined });
645+
deps.push({ name, parent: undefined });
646646
const resolvedSymbol = this.resolveSymbol(
647647
cubeName,
648648
name

packages/cubejs-schema-compiler/test/integration/postgres/sql-generation.test.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,80 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
968968
}
969969
]));
970970

971+
it('rolling window with two time dimension granularities one custom one regular', async () => runQueryTest({
972+
973+
measures: [
974+
'visitors.countRollingWeekToDate'
975+
],
976+
timeDimensions: [
977+
{
978+
dimension: 'visitors.created_at',
979+
granularity: 'three_days',
980+
dateRange: ['2017-01-01', '2017-01-10']
981+
},
982+
{
983+
dimension: 'visitors.created_at',
984+
granularity: 'day',
985+
dateRange: ['2017-01-01', '2017-01-10']
986+
}
987+
],
988+
order: [{
989+
id: 'visitors.created_at'
990+
}],
991+
timezone: 'America/Los_Angeles'
992+
}, [
993+
{
994+
visitors__count_rolling_week_to_date: null,
995+
visitors__created_at_day: '2017-01-01T00:00:00.000Z',
996+
visitors__created_at_three_days: '2017-01-01T00:00:00.000Z',
997+
},
998+
{
999+
visitors__count_rolling_week_to_date: '1',
1000+
visitors__created_at_day: '2017-01-02T00:00:00.000Z',
1001+
visitors__created_at_three_days: '2017-01-01T00:00:00.000Z',
1002+
},
1003+
{
1004+
visitors__count_rolling_week_to_date: '1',
1005+
visitors__created_at_day: '2017-01-03T00:00:00.000Z',
1006+
visitors__created_at_three_days: '2017-01-01T00:00:00.000Z',
1007+
},
1008+
{
1009+
visitors__count_rolling_week_to_date: '2',
1010+
visitors__created_at_day: '2017-01-04T00:00:00.000Z',
1011+
visitors__created_at_three_days: '2017-01-04T00:00:00.000Z',
1012+
},
1013+
{
1014+
visitors__count_rolling_week_to_date: '3',
1015+
visitors__created_at_day: '2017-01-05T00:00:00.000Z',
1016+
visitors__created_at_three_days: '2017-01-04T00:00:00.000Z',
1017+
},
1018+
{
1019+
visitors__count_rolling_week_to_date: '5',
1020+
visitors__created_at_day: '2017-01-06T00:00:00.000Z',
1021+
visitors__created_at_three_days: '2017-01-04T00:00:00.000Z',
1022+
},
1023+
{
1024+
visitors__count_rolling_week_to_date: '5',
1025+
visitors__created_at_day: '2017-01-07T00:00:00.000Z',
1026+
visitors__created_at_three_days: '2017-01-07T00:00:00.000Z',
1027+
},
1028+
{
1029+
visitors__count_rolling_week_to_date: '5',
1030+
visitors__created_at_day: '2017-01-08T00:00:00.000Z',
1031+
visitors__created_at_three_days: '2017-01-07T00:00:00.000Z',
1032+
},
1033+
{
1034+
visitors__count_rolling_week_to_date: null,
1035+
visitors__created_at_day: '2017-01-09T00:00:00.000Z',
1036+
visitors__created_at_three_days: '2017-01-07T00:00:00.000Z',
1037+
},
1038+
{
1039+
visitors__count_rolling_week_to_date: null,
1040+
visitors__created_at_day: '2017-01-10T00:00:00.000Z',
1041+
visitors__created_at_three_days: '2017-01-10T00:00:00.000Z',
1042+
}
1043+
]));
1044+
9711045
it('two rolling windows with two time dimension granularities', async () => runQueryTest({
9721046
measures: [
9731047
'visitors.countRollingUnbounded',

0 commit comments

Comments
 (0)