Skip to content

Commit 9df26d8

Browse files
MazterQyouigorlukanin
authored andcommitted
fix(cubesql): Normalize timestamp/date expressions (#10040)
Signed-off-by: Alex Qyoun-ae <[email protected]>
1 parent c1998b2 commit 9df26d8

32 files changed

+91019
-4370
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ export class BigqueryQuery extends BaseQuery {
347347
// DATEADD is being rewritten to DATE_ADD
348348
templates.functions.DATE_ADD = 'DATETIME_ADD(DATETIME({{ args[0] }}), INTERVAL {{ interval }} {{ date_part }})';
349349
templates.functions.CURRENTDATE = 'CURRENT_DATE';
350-
templates.functions.DATE = 'TIMESTAMP({{ args_concat }})';
351350
delete templates.functions.TO_CHAR;
352351
delete templates.functions.PERCENTILECONT;
353352
templates.expressions.binary = '{% if op == \'%\' %}MOD({{ left }}, {{ right }}){% else %}({{ left }} {{ op }} {{ right }}){% endif %}';

packages/cubejs-testing-drivers/fixtures/athena.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@
216216
"querying BigECommerce: rolling window YTD (month + week)",
217217
"querying BigECommerce: rolling window YTD (month + week + no gran)",
218218
"querying BigECommerce: rolling window YTD without granularity",
219-
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
220-
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)",
221219
"querying BigECommerce with Retail Calendar: totalCountRetailWeekAgo"
222220
]
223221
}

packages/cubejs-testing-drivers/fixtures/bigquery.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@
235235
"SQL API: SQL push down push to cube quoted alias",
236236
"querying BigECommerce: rolling window YTD (month + week)",
237237
"querying BigECommerce: rolling window YTD (month + week + no gran)",
238-
"querying BigECommerce: rolling window YTD without granularity",
239-
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
240-
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)"
238+
"querying BigECommerce: rolling window YTD without granularity"
241239
]
242240
}

packages/cubejs-testing-drivers/fixtures/clickhouse.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
"SKIPPED SQL API (due to inconsistency)",
237237
"---------------------------------------",
238238
"Below doesn't work probably due to strict type comparison in ClickHouse, but tests run across all DBs",
239+
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
239240
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)"
240241
]
241242
}

packages/cubejs-testing-drivers/fixtures/databricks-jdbc.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,6 @@
268268
"SQL API: Nested Rollup",
269269
"SQL API: Nested Rollup with aliases",
270270
"SQL API: Nested Rollup over asterisk",
271-
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
272-
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)",
273271
"querying BigECommerce with Retail Calendar: totalCountRetailMonthAgo",
274272
"querying BigECommerce with Retail Calendar: totalCountRetailWeekAgo",
275273
"SQL API: Timeshift measure from cube",

packages/cubejs-testing-drivers/fixtures/postgres.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@
202202
"---- Different results comparing to baseQuery version. Need to investigate ----",
203203
"querying BigECommerce: rolling window YTD (month + week)",
204204
"querying BigECommerce: rolling window YTD (month + week + no gran)",
205-
"querying BigECommerce: rolling window YTD without granularity",
206-
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
207-
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)"
205+
"querying BigECommerce: rolling window YTD without granularity"
208206
]
209207
}

packages/cubejs-testing-drivers/fixtures/redshift.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@
224224
"---- Different results comparing to baseQuery version. Need to investigate ----",
225225
"querying BigECommerce: rolling window YTD (month + week)",
226226
"querying BigECommerce: rolling window YTD (month + week + no gran)",
227-
"querying BigECommerce: rolling window YTD without granularity",
228-
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
229-
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)"
227+
"querying BigECommerce: rolling window YTD without granularity"
230228
]
231229
}

packages/cubejs-testing-drivers/fixtures/snowflake.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@
308308
"---- Different results comparing to baseQuery version. Need to investigate ----",
309309
"querying BigECommerce: rolling window YTD (month + week)",
310310
"querying BigECommerce: rolling window YTD (month + week + no gran)",
311-
"querying BigECommerce: rolling window YTD without granularity",
312-
"SQL API: Rolling Window YTD (year + month + day + date_trunc equal)",
313-
"SQL API: Rolling Window YTD (year + month + day + date_trunc IN)"
311+
"querying BigECommerce: rolling window YTD without granularity"
314312
]
315313
}

0 commit comments

Comments
 (0)