Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Tables Partitioned by Field are Broken #362

Closed
bacheson opened this issue Jul 30, 2021 · 2 comments · Fixed by #385
Closed

Tables Partitioned by Field are Broken #362

bacheson opened this issue Jul 30, 2021 · 2 comments · Fixed by #385
Milestone

Comments

@bacheson
Copy link

bacheson commented Jul 30, 2021

Bug Report

I mentioned this in another somewhat related bug. I thought I'd create this here as it's a critical bug that's been ongoing for months now.

Expected Behavior

I should be able to query a field partitioned table using $__timeFilter.

Actual Behavior

The plugin automatically adds _PARTITIONTIME functions. This is only supported by tables partitioned by ingestion time, NOT tables partitioned on a date/time field.

results in the error:
Unrecognized name: _PARTITIONTIME

Steps to Reproduce the Problem

  1. Create table with a timestamp field
  2. Partition on the timestamp field (DO NOT partition by ingestion time)
  3. Query the table using $__timeFilter

Specifications

  • Version: 2.0.2
  • Platform: Linux
  • Grafana Version:8
ofir5300 added a commit that referenced this issue Nov 21, 2021
…ioned (#385)

* Handle time range filtering issue for both partitioned and non-partitioned (fixes #321, #325, #334, #362)

* Fix UTC conversion & usage
@ofir5300 ofir5300 added this to the 2.0.3 milestone Nov 21, 2021
@hqm
Copy link

hqm commented Jan 9, 2022

This does not appear to be fixed, I installed 2.0.3 plugin and I still get this error

My query is getting incorrectly rewritten to include _PARTITIONTIME

SELECT timestamp_trunc(start_time, second) time ,
cast(ceiling(count(id)/15) as int) workers,
cast(ceiling(sum(case when person.in_front_of_press then 1 else 0 end)/15) as int) at_press
FROM leela-vision.factory1.vsrc_C16_6A
CROSS JOIN
UNNEST(objects) as person
where _PARTITIONTIME >= '2022-01-09 05:09:54' AND _PARTITIONTIME < '2022-01-09 11:09:54' AND
start_time between 1641704974 and 1641726574
AND person.class_name = 'person'
-- AND person.in_front_of_closed_press
GROUP BY time
order by time asc

@ofir5300
Copy link
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants