raintank / crate-datasource

Apache License 2.0
13 stars 8 forks source link

plotting raw value tries to GROUP BY #19

Closed jodok closed 7 years ago

jodok commented 8 years ago

i'm trying to plot a single value without aggregation

raw

and the datasource is being queried like that:

{"stmt":"SELECT count(*) FROM \"mruepp\".\"missionj\" WHERE timestamp >= ? AND timestamp <= ? AND payload['fieldname'] = 'Weight PCR_Line01' GROUP BY , payload['value']","args":[1479547509769,1479569109770]}

but it should be:

{"stmt":"SELECT payload['value'] FROM \"mruepp\".\"missionj\" WHERE timestamp >= ? AND timestamp <= ? AND payload['fieldname'] = 'Weight PCR_Line01'","args":[1479547509769,1479569109770]}
jodok commented 8 years ago

ok, could debug this further - problem occurs if the Group By Time Interval is set to Auto

alexanderzobnin commented 8 years ago

It's because we invoke SELECT count(*) query first to determine amount of points to return and select proper Group By Time Interval. See #11. Can you show second query (after SELECT count(*))?

joemoe commented 8 years ago

it seems like there is a new problem. auto does now a query crate can't handle anymore.

what do mean by show second query?

joemoe commented 8 years ago

hm, it worked now. there seems to be some edge case.

joemoe commented 8 years ago

can't reproduce it anymore.

joemoe commented 8 years ago

is this still an issue for you @jodok?

jodok commented 8 years ago

yes, still an issue. is there a way i can help to debug?

joemoe commented 8 years ago

@alexanderzobnin we narrowed it down to having no alias set.