diff --git a/src/bigquery_query.ts b/src/bigquery_query.ts index 7df81166..84f8bb4f 100644 --- a/src/bigquery_query.ts +++ b/src/bigquery_query.ts @@ -378,19 +378,44 @@ export default class BigQueryQuery { return query; } + // public getPartitionFieldType() { // TODO - impklement if possible + // // const sqlWithNoVariables = this.templateSrv.replace(tmpQ, options.scopedVars, this.interpolateVariable); + // const [project, dataset, table] = BigQueryDatasource._extractFromClause(this.target.from); + // const datasource = new BigQueryDatasource() + // this.getDateFields(project, dataset, table) + // .then(dateFields => { + // const tm = BigQueryDatasource._FindTimeField(tmpQ, dateFields); + // this.queryModel.target.timeColumn = tm.text; + // this.queryModel.target.timeColumnType = tm.value; + // this.queryModel.target.table = table; + // }) + // .catch((err) => { + // console.log(err); + // }); + // } + + // Detects either date or timestamp, only if not comment out + static hasDateFilter(whereClause) { + return whereClause.match(/((?