File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/cubejs-schema-compiler/src/adapter Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export class BigqueryQuery extends BaseQuery {
4242 }
4343
4444 public convertTz ( field ) {
45- return `DATETIME(${ this . timeStampCast ( field ) } , '${ this . timezone } ')` ;
45+ return `TIMESTAMP( DATETIME(${ field } ) , '${ this . timezone } ')` ;
4646 }
4747
4848 public timeStampCast ( value ) {
@@ -58,7 +58,7 @@ export class BigqueryQuery extends BaseQuery {
5858 }
5959
6060 public timeGroupedColumn ( granularity , dimension ) {
61- return `DATETIME_TRUNC(${ dimension } , ${ GRANULARITY_TO_INTERVAL [ granularity ] } )` ;
61+ return this . timeStampCast ( `DATETIME_TRUNC(${ dimension } , ${ GRANULARITY_TO_INTERVAL [ granularity ] } )` ) ;
6262 }
6363
6464 /**
@@ -72,7 +72,7 @@ export class BigqueryQuery extends BaseQuery {
7272
7373 return `(${ this . dateTimeCast ( `'${ origin } '` ) } + INTERVAL ${ intervalFormatted } *
7474 CAST(FLOOR(
75- DATETIME_DIFF(${ source } , ${ this . dateTimeCast ( `'${ origin } '` ) } , ${ timeUnit } ) /
75+ DATETIME_DIFF(${ this . dateTimeCast ( source ) } , ${ this . dateTimeCast ( `'${ origin } '` ) } , ${ timeUnit } ) /
7676 DATETIME_DIFF(${ beginOfTime } + INTERVAL ${ intervalFormatted } , ${ beginOfTime } , ${ timeUnit } )
7777 ) AS INT64))` ;
7878 }
You can’t perform that action at this time.
0 commit comments