doitintl / bigquery-grafana

Google BigQuery Datasource Plugin for Grafana. (NO LONGER MAINTAINED)
https://www.doit-intl.com/labs/
MIT License
242 stars 76 forks source link

$__timeGroup does not expand in subqueries #371

Closed ptomasroos closed 2 years ago

ptomasroos commented 3 years ago

When the macro $__timeGroup is inserted into a raw sql query, its not expanded when its placed inside a subquery. I would expect the timeGroup to be resolved / replaced anywhere in the query not just the outer query.

Bug Report

#standardSQL
SELECT
  `time`,
  group
FROM (
SELECT
    $__timeGroup(timestamp, auto),
    group
  FROM
    `***`)

Expected Behavior

I expect the $_timeGroup to expand into the regular expression of TIMESTAMP_SECONDS(DIV(UNIX_SECONDS(timestamp), x) * x) AS time,

Actual Behavior

Its not expanded and query fails.

Steps to Reproduce the Problem

  1. Take a regular query with a raw sql $__timeGroup(timestamp, auto)
  2. Put it inside a sub query and just wrap that query into a subquery

Specifications

ofir5300 commented 2 years ago

Please update to v2.0.3 (Available on Grafana cloud) and let me know if it persist

ofir5300 commented 2 years ago

We are retiring the DoiT International BigQuery DataSource plugin for Grafana. We recommend that you migrate to the official Google BigQuery data source maintained by Grafana. In August 2022, we will cease all development and archive the GitHub project.

We are sorry for any inconvenience.