Skip to content

Commit 31b92b1

Browse files
committed
[FIXUP] postgres new aliases
1 parent 2337baa commit 31b92b1

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

packages/cubejs-schema-compiler/test/integration/postgres/pre-aggregations-time.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ for (const [index, schema] of Object.entries(SCHEMA_VARIANTS)) {
204204
[
205205
{
206206
visitors__count: '5',
207-
visitors__created_at_week: '2017-01-02T00:00:00.000Z'
207+
visitors__created_at__week: '2017-01-02T00:00:00.000Z'
208208
},
209209
]
210210
);

packages/cubejs-schema-compiler/test/integration/postgres/pre-aggregations.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,19 +620,19 @@ describe('PreAggregations', () => {
620620
expect(res).toEqual(
621621
[
622622
{
623-
visitors_view__created_at_day: '2017-01-02T00:00:00.000Z',
623+
visitors_view__created_at__day: '2017-01-02T00:00:00.000Z',
624624
visitors_view__ratio: '0.33333333333333333333'
625625
},
626626
{
627-
visitors_view__created_at_day: '2017-01-04T00:00:00.000Z',
627+
visitors_view__created_at__day: '2017-01-04T00:00:00.000Z',
628628
visitors_view__ratio: '0.50000000000000000000'
629629
},
630630
{
631-
visitors_view__created_at_day: '2017-01-05T00:00:00.000Z',
631+
visitors_view__created_at__day: '2017-01-05T00:00:00.000Z',
632632
visitors_view__ratio: '1.00000000000000000000'
633633
},
634634
{
635-
visitors_view__created_at_day: '2017-01-06T00:00:00.000Z',
635+
visitors_view__created_at__day: '2017-01-06T00:00:00.000Z',
636636
visitors_view__ratio: null
637637
}
638638
]

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

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,10 @@ describe('SQL Generation', () => {
866866
}],
867867
timezone: 'America/Los_Angeles'
868868
}, [
869-
{ visitors__created_at_sql_utils_day: '2017-01-02T00:00:00.000Z', visitors__visitor_count: '1' },
870-
{ visitors__created_at_sql_utils_day: '2017-01-04T00:00:00.000Z', visitors__visitor_count: '1' },
871-
{ visitors__created_at_sql_utils_day: '2017-01-05T00:00:00.000Z', visitors__visitor_count: '1' },
872-
{ visitors__created_at_sql_utils_day: '2017-01-06T00:00:00.000Z', visitors__visitor_count: '2' }
869+
{ visitors__created_at_sql_utils__day: '2017-01-02T00:00:00.000Z', visitors__visitor_count: '1' },
870+
{ visitors__created_at_sql_utils__day: '2017-01-04T00:00:00.000Z', visitors__visitor_count: '1' },
871+
{ visitors__created_at_sql_utils__day: '2017-01-05T00:00:00.000Z', visitors__visitor_count: '1' },
872+
{ visitors__created_at_sql_utils__day: '2017-01-06T00:00:00.000Z', visitors__visitor_count: '2' }
873873
]));
874874

875875
it('running total total', async () => runQueryTest({
@@ -1361,15 +1361,15 @@ describe('SQL Generation', () => {
13611361
}]
13621362
}, [
13631363
{
1364-
visitors__min_visitor_checkin_date_day: '2017-01-02T00:00:00.000Z',
1364+
visitors__min_visitor_checkin_date__day: '2017-01-02T00:00:00.000Z',
13651365
visitors__visitor_count: '1'
13661366
},
13671367
{
1368-
visitors__min_visitor_checkin_date_day: '2017-01-04T00:00:00.000Z',
1368+
visitors__min_visitor_checkin_date__day: '2017-01-04T00:00:00.000Z',
13691369
visitors__visitor_count: '1'
13701370
},
13711371
{
1372-
visitors__min_visitor_checkin_date_day: '2017-01-05T00:00:00.000Z',
1372+
visitors__min_visitor_checkin_date__day: '2017-01-05T00:00:00.000Z',
13731373
visitors__visitor_count: '1'
13741374
}
13751375
]).then(() => {
@@ -1394,15 +1394,15 @@ describe('SQL Generation', () => {
13941394
}]
13951395
}, [
13961396
{
1397-
visitors__min_visitor_checkin_date_day: '2017-01-02T00:00:00.000Z',
1397+
visitors__min_visitor_checkin_date__day: '2017-01-02T00:00:00.000Z',
13981398
visitors__visitor_count: '1'
13991399
},
14001400
{
1401-
visitors__min_visitor_checkin_date_day: '2017-01-04T00:00:00.000Z',
1401+
visitors__min_visitor_checkin_date__day: '2017-01-04T00:00:00.000Z',
14021402
visitors__visitor_count: '1'
14031403
},
14041404
{
1405-
visitors__min_visitor_checkin_date_day: '2017-01-05T00:00:00.000Z',
1405+
visitors__min_visitor_checkin_date__day: '2017-01-05T00:00:00.000Z',
14061406
visitors__visitor_count: '1'
14071407
}
14081408
]));
@@ -1635,12 +1635,12 @@ describe('SQL Generation', () => {
16351635
ungrouped: true,
16361636
allowUngroupedWithoutPrimaryKey: true,
16371637
}, [
1638-
{ visitor_checkins__created_at_day: '2017-01-02T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1639-
{ visitor_checkins__created_at_day: '2017-01-03T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1640-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1641-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1642-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1643-
{ visitor_checkins__created_at_day: '2017-01-05T00:00:00.000Z', visitor_checkins__google_sourced_checkins: 1 },
1638+
{ visitor_checkins__created_at__day: '2017-01-02T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1639+
{ visitor_checkins__created_at__day: '2017-01-03T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1640+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1641+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1642+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__google_sourced_checkins: null },
1643+
{ visitor_checkins__created_at__day: '2017-01-05T00:00:00.000Z', visitor_checkins__google_sourced_checkins: 1 },
16441644
]));
16451645

16461646
it('ungrouped filtered distinct count', () => runQueryTest({
@@ -1659,12 +1659,12 @@ describe('SQL Generation', () => {
16591659
ungrouped: true,
16601660
allowUngroupedWithoutPrimaryKey: true,
16611661
}, [
1662-
{ visitor_checkins__created_at_day: '2017-01-02T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1663-
{ visitor_checkins__created_at_day: '2017-01-03T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1664-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1665-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1666-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1667-
{ visitor_checkins__created_at_day: '2017-01-05T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: 1 },
1662+
{ visitor_checkins__created_at__day: '2017-01-02T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1663+
{ visitor_checkins__created_at__day: '2017-01-03T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1664+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1665+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1666+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: null },
1667+
{ visitor_checkins__created_at__day: '2017-01-05T00:00:00.000Z', visitor_checkins__unique_google_sourced_checkins: 1 },
16681668
]));
16691669

16701670
it('ungrouped ratio measure', () => runQueryTest({
@@ -1683,12 +1683,12 @@ describe('SQL Generation', () => {
16831683
ungrouped: true,
16841684
allowUngroupedWithoutPrimaryKey: true,
16851685
}, [
1686-
{ visitor_checkins__created_at_day: '2017-01-02T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1687-
{ visitor_checkins__created_at_day: '2017-01-03T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1688-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1689-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1690-
{ visitor_checkins__created_at_day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1691-
{ visitor_checkins__created_at_day: '2017-01-05T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1686+
{ visitor_checkins__created_at__day: '2017-01-02T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1687+
{ visitor_checkins__created_at__day: '2017-01-03T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1688+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1689+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1690+
{ visitor_checkins__created_at__day: '2017-01-04T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
1691+
{ visitor_checkins__created_at__day: '2017-01-05T00:00:00.000Z', visitor_checkins__unique_sources_per_checking: 1 },
16921692
]));
16931693

16941694
it('builds geo dimension', () => runQueryTest({
@@ -1852,11 +1852,11 @@ describe('SQL Generation', () => {
18521852
timezone: 'America/Los_Angeles'
18531853
}, [
18541854
{
1855-
visitors__created_at_year: '2016-01-01T00:00:00.000Z',
1855+
visitors__created_at__year: '2016-01-01T00:00:00.000Z',
18561856
visitors__visitor_count: '1'
18571857
},
18581858
{
1859-
visitors__created_at_year: '2017-01-01T00:00:00.000Z',
1859+
visitors__created_at__year: '2017-01-01T00:00:00.000Z',
18601860
visitors__visitor_count: '5'
18611861
}
18621862
]));
@@ -1905,19 +1905,19 @@ describe('SQL Generation', () => {
19051905
}],
19061906
timezone: 'America/Los_Angeles'
19071907
}, [{
1908-
visitors__created_at_second: '2016-09-06T17:00:00.000Z',
1908+
visitors__created_at__second: '2016-09-06T17:00:00.000Z',
19091909
visitors__visitor_count: '1'
19101910
}, {
1911-
visitors__created_at_second: '2017-01-02T16:00:00.000Z',
1911+
visitors__created_at__second: '2017-01-02T16:00:00.000Z',
19121912
visitors__visitor_count: '1'
19131913
}, {
1914-
visitors__created_at_second: '2017-01-04T16:00:00.000Z',
1914+
visitors__created_at__second: '2017-01-04T16:00:00.000Z',
19151915
visitors__visitor_count: '1'
19161916
}, {
1917-
visitors__created_at_second: '2017-01-05T16:00:00.000Z',
1917+
visitors__created_at__second: '2017-01-05T16:00:00.000Z',
19181918
visitors__visitor_count: '1'
19191919
}, {
1920-
visitors__created_at_second: '2017-01-06T16:00:00.000Z',
1920+
visitors__created_at__second: '2017-01-06T16:00:00.000Z',
19211921
visitors__visitor_count: '2'
19221922
}]));
19231923

@@ -2435,27 +2435,27 @@ describe('SQL Generation', () => {
24352435
},
24362436
[{
24372437
visitors__source: 'google',
2438-
visitors__updated_at_day: '2017-01-20T00:00:00.000Z',
2438+
visitors__updated_at__day: '2017-01-20T00:00:00.000Z',
24392439
visitors__adjusted_rank_sum: null,
24402440
visitors__visitor_revenue: null
24412441
}, {
24422442
visitors__source: 'some',
2443-
visitors__updated_at_day: '2017-01-15T00:00:00.000Z',
2443+
visitors__updated_at__day: '2017-01-15T00:00:00.000Z',
24442444
visitors__adjusted_rank_sum: '200.1',
24452445
visitors__visitor_revenue: '200'
24462446
}, {
24472447
visitors__source: 'some',
2448-
visitors__updated_at_day: '2017-01-30T00:00:00.000Z',
2448+
visitors__updated_at__day: '2017-01-30T00:00:00.000Z',
24492449
visitors__adjusted_rank_sum: '100.1',
24502450
visitors__visitor_revenue: '100'
24512451
}, {
24522452
visitors__source: null,
2453-
visitors__updated_at_day: '2016-09-07T00:00:00.000Z',
2453+
visitors__updated_at__day: '2016-09-07T00:00:00.000Z',
24542454
visitors__adjusted_rank_sum: null,
24552455
visitors__visitor_revenue: null
24562456
}, {
24572457
visitors__source: null,
2458-
visitors__updated_at_day: '2017-01-25T00:00:00.000Z',
2458+
visitors__updated_at__day: '2017-01-25T00:00:00.000Z',
24592459
visitors__adjusted_rank_sum: null,
24602460
visitors__visitor_revenue: null
24612461
}]
@@ -2546,27 +2546,27 @@ describe('SQL Generation', () => {
25462546
},
25472547
[{
25482548
visitors_multi_stage__source: 'google',
2549-
visitors_multi_stage__updated_at_day: '2017-01-20T00:00:00.000Z',
2549+
visitors_multi_stage__updated_at__day: '2017-01-20T00:00:00.000Z',
25502550
visitors_multi_stage__adjusted_rank_sum: null,
25512551
visitors_multi_stage__visitor_revenue: null
25522552
}, {
25532553
visitors_multi_stage__source: 'some',
2554-
visitors_multi_stage__updated_at_day: '2017-01-15T00:00:00.000Z',
2554+
visitors_multi_stage__updated_at__day: '2017-01-15T00:00:00.000Z',
25552555
visitors_multi_stage__adjusted_rank_sum: '200.1',
25562556
visitors_multi_stage__visitor_revenue: '200'
25572557
}, {
25582558
visitors_multi_stage__source: 'some',
2559-
visitors_multi_stage__updated_at_day: '2017-01-30T00:00:00.000Z',
2559+
visitors_multi_stage__updated_at__day: '2017-01-30T00:00:00.000Z',
25602560
visitors_multi_stage__adjusted_rank_sum: '100.1',
25612561
visitors_multi_stage__visitor_revenue: '100'
25622562
}, {
25632563
visitors_multi_stage__source: null,
2564-
visitors_multi_stage__updated_at_day: '2016-09-07T00:00:00.000Z',
2564+
visitors_multi_stage__updated_at__day: '2016-09-07T00:00:00.000Z',
25652565
visitors_multi_stage__adjusted_rank_sum: null,
25662566
visitors_multi_stage__visitor_revenue: null
25672567
}, {
25682568
visitors_multi_stage__source: null,
2569-
visitors_multi_stage__updated_at_day: '2017-01-25T00:00:00.000Z',
2569+
visitors_multi_stage__updated_at__day: '2017-01-25T00:00:00.000Z',
25702570
visitors_multi_stage__adjusted_rank_sum: null,
25712571
visitors_multi_stage__visitor_revenue: null
25722572
}]

packages/cubejs-schema-compiler/test/integration/postgres/yaml-compiler.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ views:
422422
[{
423423
line_items_view__aliased_customers_full_name: 'Foo',
424424
line_items_view__count: '1',
425-
line_items_view__orders_time_day: '2022-01-01T00:00:00.000Z',
425+
line_items_view__orders_time__day: '2022-01-01T00:00:00.000Z',
426426
}]
427427
);
428428
});

0 commit comments

Comments
 (0)