-
Notifications
You must be signed in to change notification settings - Fork 77
_PARTITIONTIME filter is added to queries on table without partitions #325
Comments
As a workaround I'm currently adding an empty results query at the beginning using another table that does have a time partition so that it gets the SELECT CURRENT_TIMESTAMP(), 0 FROM `$source_table` WHERE 1 = 2 UNION ALL
SELECT ... |
@ofir5300 this problem still exists in v2.0.2 ... this worked seamlessly in v1.x also using $__timeFilter(timestamp) always injects _PARTITIONTIME when the table isn't partitioned: and then results in: |
Ok, thank you for sharing this information @bacheson |
Well I was using a table with no partition but was not able to reproduce that issue, I might be missing something though. @peikk0 |
@ofir5300 I have changed jobs in the meantime so I'm no longer able to test this particular issue. That was happening with raw SQL queries with a table using a JSON file as external data, no partition was configured (no need for one as the file was tiny and there wasn't any field that would have been a good fit for that anyway). Also all my BigQuery panels were using raw SQL and all of them had the WHERE clause automatically modified with the partition filter, which was particularly annoying with some queries that needed to run outside of the selected timerange (eg. time-shifted graphs and table). I still think there need to be an option to explicitly disable this feature, either per query or globally. |
Related issue: |
Hi @ofir5300, Grafana Query:
Rendered query:
|
Bug Report
I have a couple very small tables without any partitioning, and the timerange filter on
_PARTITIONTIME
is added to queries on those tables, causing the query to fail because the column doesn't exist.Again it would be nice to have an option for disabling any sort of automatic query alteration, I prefer setting the partition filter explicitly when it is needed.
Expected Behavior
This query using a table without partitioning stays unaltered and works:
Actual Behavior
The query above is modified to:
and fails with
Unrecognized name: _PARTITIONTIME; Did you mean _PARTITION_NAME? at [6:7]
This doesn't happen if the WHERE clause is missing though.
Steps to Reproduce the Problem
Specifications
The text was updated successfully, but these errors were encountered: