questdb / grafana-questdb-datasource

Questdb datasource plugin for Grafana.
Apache License 2.0
9 stars 0 forks source link

Removing aggregate results in wrong UI value and wrong SQL code #112

Open jbsgh opened 1 month ago

jbsgh commented 1 month ago

To reproduce

  1. Open Query Builder
  2. Select Table as Time series
  3. Add 3 Aggregates: FIRST item1 as i1 MIN item2 as i2 LAST item3 as i3 This results in the correct SQL: SELECT time as time, first(item1) i1, min(item2) i2, last(item3) i3 ...
  4. Remove the 2. aggregate by clicking on the icon
  5. The remaining 2 aggregates are shown as FIRST item1 as i1 LAST item3 as i2 The alias for the last item has changed from i3 to i2. That's wrong.
  6. The resulting SQL is wrong: SELECT time as time, first(item1) i3, last(item3) i3 ... The alias of the first item has changed from i1 to i3. The SQL does not reflect the visual aggregate configuration anymore. When running the query, the DB reports "duplicate column [name=i3]"

QuestDB version:

8.1.2

Grafana version:

11.2.2

Plugin version:

ZIP from Maciej from 5th July 24

OS, in case of Docker specify Docker and the Host OS:

Debian 12

Full Name:

Jan Bartels

Affiliation:

Siempelkamp

Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?

Additional context

No response