This repository was archived by the owner on Dec 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +25
-3
lines changed
Expand file tree Collapse file tree 5 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -58979,7 +58979,12 @@ function () {
5897958979 }
5898058980
5898158981 var range = BigQueryQuery.quoteFiledName(this.target.timeColumn) + " BETWEEN " + from + " AND " + to;
58982- return q.replace(/\$__timeFilter\(([\w_.]+)\)/g, range);
58982+ var fromRange = BigQueryQuery.quoteFiledName(this.target.timeColumn) + " > " + from + " ";
58983+ var toRange = BigQueryQuery.quoteFiledName(this.target.timeColumn) + " < " + to + " ";
58984+ q = q.replace(/\$__timeFilter\(([\w_.]+)\)/g, range);
58985+ q = q.replace(/\$__timeFrom\(([\w_.]+)\)/g, fromRange);
58986+ q = q.replace(/\$__timeTo\(([\w_.]+)\)/g, toRange);
58987+ return q;
5898358988 };
5898458989
5898558990 BigQueryQuery.prototype.replacetimeGroupAlias = function (q, alias) {
Original file line number Diff line number Diff line change 169169
170170Macros:
171171- $__timeFilter(column) -> column BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:01:17Z'
172+ - $__timeFrom(column) -> column > '2017-04-21T05:01:17Z'
173+ - $__timeTo(column) -> column < '2017-04-21T05:01:17Z'
172174- $__timeGroup(column,'5m') -> (extract(epoch from column)/300)::bigint*300 AS "time"
173175- $__timeShifting(1m) -> compare data from the current range to the previous range
174176
Original file line number Diff line number Diff line change @@ -545,7 +545,20 @@ export default class BigQueryQuery {
545545 from +
546546 " AND " +
547547 to ;
548- return q . replace ( / \$ _ _ t i m e F i l t e r \( ( [ \w _ . ] + ) \) / g, range ) ;
548+ const fromRange =
549+ BigQueryQuery . quoteFiledName ( this . target . timeColumn ) +
550+ " > " +
551+ from +
552+ " " ;
553+ const toRange =
554+ BigQueryQuery . quoteFiledName ( this . target . timeColumn ) +
555+ " < " +
556+ to +
557+ " " ;
558+ q = q . replace ( / \$ _ _ t i m e F i l t e r \( ( [ \w _ . ] + ) \) / g, range ) ;
559+ q = q . replace ( / \$ _ _ t i m e F r o m \( ( [ \w _ . ] + ) \) / g, fromRange ) ;
560+ q = q . replace ( / \$ _ _ t i m e T o \( ( [ \w _ . ] + ) \) / g, toRange ) ;
561+ return q ;
549562 }
550563
551564 public replacetimeGroupAlias ( q , alias : boolean ) {
Original file line number Diff line number Diff line change 169169
170170Macros:
171171- $__timeFilter(column) -> column BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:01:17Z'
172+ - $__timeFrom(column) -> column > '2017-04-21T05:01:17Z'
173+ - $__timeTo(column) -> column < '2017-04-21T05:01:17Z'
172174- $__timeGroup(column,'5m') -> (extract(epoch from column)/300)::bigint*300 AS "time"
173175- $__timeShifting(1m) -> compare data from the current range to the previous range
174176
You can’t perform that action at this time.
0 commit comments