Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ export class BigqueryQuery extends BaseQuery {
templates.types.decimal = 'BIGDECIMAL({{ precision }},{{ scale }})';
templates.types.binary = 'BYTES';
templates.operators.is_not_distinct_from = 'IS NOT DISTINCT FROM';
templates.join_types.full = 'FULL';
templates.statements.time_series_select = 'SELECT DATETIME(TIMESTAMP(f)) date_from, DATETIME(TIMESTAMP(t)) date_to \n' +
'FROM (\n' +
'{% for time_item in seria %}' +
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-testing-drivers/fixtures/athena.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures",

"---------------------------------------",
"Custom Granularities ",
Expand Down Expand Up @@ -198,6 +199,7 @@
"Tesseract: querying BigECommerce with Retail Calendar: totalCountRetailWeekAgo",
"SQL API: Timeshift measure from cube",
"querying BigECommerce: multi-stage group by time dimension",
"querying BigECommerce: SeveralMultiStageMeasures",

"querying BigECommerce: rolling window by 2 week",
"querying custom granularities ECommerce: count by three_months_by_march + no dimension",
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-testing-drivers/fixtures/bigquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures",

"---------------------------------------",
"SKIPPED SQL API (Need work)",
Expand Down Expand Up @@ -220,6 +221,7 @@
"querying BigECommerce: rolling count_distinct_approx window by 2 week",
"querying BigECommerce: rolling count_distinct_approx window by 2 month",
"querying BigECommerce: totalProfitYearAgo",
"querying BigECommerce: SeveralMultiStageMeasures",
"SQL API: post-aggregate percentage of total",
"SQL API: Simple Rollup",
"SQL API: Rollup over exprs",
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-testing-drivers/fixtures/clickhouse.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures",

"---------------------------------------",
"Custom Granularities ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures",

"---------------------------------------",
"Custom Granularities ",
Expand Down Expand Up @@ -274,6 +275,7 @@
"Tesseract: querying BigECommerce with Retail Calendar: totalCountRetailMonthAgo",
"Tesseract: querying BigECommerce with Retail Calendar: totalCountRetailWeekAgo",
"Tesseract: SQL API: Timeshift measure from cube",
"querying BigECommerce: SeveralMultiStageMeasures",

"---- Different results comparing to baseQuery version. Need to investigate ----",
"querying ECommerce: dimensions",
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-testing-drivers/fixtures/mssql.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures",

"---------------------------------------",
"SKIPPED SQL API (Need work)",
Expand Down
1 change: 1 addition & 0 deletions packages/cubejs-testing-drivers/fixtures/mysql.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures",

"---------------------------------------",
"Custom Granularities ",
Expand Down
3 changes: 2 additions & 1 deletion packages/cubejs-testing-drivers/fixtures/postgres.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
"querying BigECommerce: multi-stage group by time dimension",
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions"
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures"
],
"tesseractSkip": [
"querying Products: dimensions -- doesn't work wo ordering",
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-testing-drivers/fixtures/redshift.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures",

"---------------------------------------",
"SKIPPED SQL API (Need work) ",
Expand All @@ -210,6 +211,7 @@
"querying BigECommerce: rolling window by 2 month without date range",
"querying BigECommerce: rolling window YTD without date range",
"querying custom granularities ECommerce: count by two_mo_by_feb + no dimension + rollingCountByLeading without date range",
"querying BigECommerce: SeveralMultiStageMeasures",

"SQL API: Simple Rollup",
"SQL API: Complex Rollup",
Expand Down
3 changes: 2 additions & 1 deletion packages/cubejs-testing-drivers/fixtures/snowflake.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@
"querying BigECommerce: multi-stage group by time dimension",
"querying SwitchSourceTest: simple cross join",
"querying SwitchSourceTest: full cross join",
"querying SwitchSourceTest: filter by switch dimensions"
"querying SwitchSourceTest: filter by switch dimensions",
"querying BigECommerce: SeveralMultiStageMeasures"
],
"tesseractSkip": [
"for the Customers.RollingExternal",
Expand Down
17 changes: 17 additions & 0 deletions packages/cubejs-testing-drivers/src/tests/testQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,23 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
expect(response.rawData()).toMatchSnapshot();
});

execute('querying BigECommerce: SeveralMultiStageMeasures', async () => {
const response = await client.load({
measures: [
'BigECommerce.totalProfitYearAgo',
'BigECommerce.percentageOfTotalForStatus',
'BigECommerce.totalCountRetailMonthAgo',
'BigECommerce.count',
],
timeDimensions: [{
dimension: 'BigECommerce.orderDate',
granularity: 'month',
dateRange: ['2020-01-01', '2020-12-31'],
}],
});
expect(response.rawData()).toMatchSnapshot();
});

execute('querying BigECommerce: filtering with possible casts', async () => {
const response = await client.load({
measures: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15545,6 +15545,99 @@ Array [
]
`;

exports[`Queries with the @cubejs-backend/postgres-driver querying BigECommerce: SeveralMultiStageMeasures 1`] = `
Array [
Object {
"BigECommerce.count": "2",
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": null,
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "1",
"BigECommerce.orderDate": "2020-02-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-02-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "2",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "2",
"BigECommerce.orderDate": "2020-03-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-03-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "1",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "1",
"BigECommerce.orderDate": "2020-04-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-04-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "2",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "5",
"BigECommerce.orderDate": "2020-05-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-05-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "1",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "7",
"BigECommerce.orderDate": "2020-06-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-06-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "5",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": null,
"BigECommerce.orderDate": "2020-07-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-07-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": null,
"BigECommerce.totalCountRetailMonthAgo": "7",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "6",
"BigECommerce.orderDate": "2020-09-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-09-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": null,
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "4",
"BigECommerce.orderDate": "2020-10-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-10-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "6",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "9",
"BigECommerce.orderDate": "2020-11-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-11-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "4",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "7",
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "9",
"BigECommerce.totalProfitYearAgo": null,
},
]
`;

exports[`Queries with the @cubejs-backend/postgres-driver querying BigECommerce: filtering with possible casts 1`] = `
Array [
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15659,6 +15659,99 @@ Array [
]
`;

exports[`Queries with the @cubejs-backend/snowflake-driver querying BigECommerce: SeveralMultiStageMeasures 1`] = `
Array [
Object {
"BigECommerce.count": "2",
"BigECommerce.orderDate": "2020-01-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-01-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": null,
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "1",
"BigECommerce.orderDate": "2020-02-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-02-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "2",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "2",
"BigECommerce.orderDate": "2020-03-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-03-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "1",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "1",
"BigECommerce.orderDate": "2020-04-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-04-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "2",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "5",
"BigECommerce.orderDate": "2020-05-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-05-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "1",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "7",
"BigECommerce.orderDate": "2020-06-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-06-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "5",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": null,
"BigECommerce.orderDate": "2020-07-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-07-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": null,
"BigECommerce.totalCountRetailMonthAgo": "7",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "6",
"BigECommerce.orderDate": "2020-09-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-09-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": null,
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "4",
"BigECommerce.orderDate": "2020-10-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-10-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "6",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "9",
"BigECommerce.orderDate": "2020-11-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-11-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "4",
"BigECommerce.totalProfitYearAgo": null,
},
Object {
"BigECommerce.count": "7",
"BigECommerce.orderDate": "2020-12-01T00:00:00.000",
"BigECommerce.orderDate.month": "2020-12-01T00:00:00.000",
"BigECommerce.percentageOfTotalForStatus": "100",
"BigECommerce.totalCountRetailMonthAgo": "9",
"BigECommerce.totalProfitYearAgo": null,
},
]
`;

exports[`Queries with the @cubejs-backend/snowflake-driver querying BigECommerce: filtering with possible casts 1`] = `
Array [
Object {
Expand Down
Loading
Loading