This repository was archived by the owner on Dec 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -390,21 +390,25 @@ export default class BigQueryQuery {
390390 } ) ;
391391 if ( this . target . partitioned ) {
392392 const partitionedField = this . target . partitionedField ? this . target . partitionedField : '_PARTITIONTIME' ;
393- if ( this . templateSrv . timeRange && this . templateSrv . timeRange . from ) {
394- const from = `${ partitionedField } >= '${ BigQueryQuery . formatDateToString (
395- this . templateSrv . timeRange . from . _d ,
396- '-' ,
397- true
398- ) } '`;
399- conditions . push ( from ) ;
400- }
401- if ( this . templateSrv . timeRange && this . templateSrv . timeRange . to ) {
402- const to = `${ partitionedField } < '${ BigQueryQuery . formatDateToString (
403- this . templateSrv . timeRange . to . _d ,
404- '-' ,
405- true
406- ) } '`;
407- conditions . push ( to ) ;
393+ if ( this . target . timeColumn !== partitionedField ) {
394+ if ( this . templateSrv . timeRange && this . templateSrv . timeRange . from ) {
395+ let fromD = this . templateSrv . timeRange . from ;
396+ const from = `${ partitionedField } >= '${ BigQueryQuery . formatDateToString (
397+ fromD . _d ,
398+ '-' ,
399+ true
400+ ) } '`;
401+ conditions . push ( from ) ;
402+ }
403+ if ( this . templateSrv . timeRange && this . templateSrv . timeRange . to ) {
404+ let toD = this . templateSrv . timeRange . to ;
405+ const to = `${ partitionedField } < '${ BigQueryQuery . formatDateToString (
406+ toD . _d ,
407+ '-' ,
408+ true
409+ ) } '`;
410+ conditions . push ( to ) ;
411+ }
408412 }
409413 }
410414 if ( this . target . sharded ) {
You can’t perform that action at this time.
0 commit comments