Skip to content

Commit 3f528e1

Browse files
committed
should work
1 parent 3674ef8 commit 3f528e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class BigqueryQuery extends BaseQuery {
4242
}
4343

4444
public convertTz(field) {
45-
return `DATETIME(${field}, '${this.timezone}')`;
45+
return `DATETIME(${this.timeStampCast(field)}, '${this.timezone}')`;
4646
}
4747

4848
public timeStampCast(value) {
@@ -262,7 +262,7 @@ export class BigqueryQuery extends BaseQuery {
262262
templates.expressions.binary = '{% if op == \'%\' %}MOD({{ left }}, {{ right }}){% else %}({{ left }} {{ op }} {{ right }}){% endif %}';
263263
templates.expressions.interval = 'INTERVAL {{ interval }}';
264264
templates.expressions.extract = 'EXTRACT({% if date_part == \'DOW\' %}DAYOFWEEK{% elif date_part == \'DOY\' %}DAYOFYEAR{% else %}{{ date_part }}{% endif %} FROM {{ expr }})';
265-
templates.expressions.timestamp_literal = 'TIMESTAMP(\'{{ value }}\')';
265+
templates.expressions.timestamp_literal = 'DATETIME(TIMESTAMP(\'{{ value }}\'))';
266266
delete templates.expressions.ilike;
267267
delete templates.expressions.like_escape;
268268
templates.filters.like_pattern = 'CONCAT({% if start_wild %}\'%\'{% else %}\'\'{% endif %}, LOWER({{ value }}), {% if end_wild %}\'%\'{% else %}\'\'{% endif %})';

0 commit comments

Comments
 (0)