Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inner Join is not working correctly #88033

Open
sensej-j opened this issue May 18, 2024 · 2 comments
Open

Inner Join is not working correctly #88033

sensej-j opened this issue May 18, 2024 · 2 comments

Comments

@sensej-j
Copy link

What happened?

Hello,
I'm trying to connect several table queries from different sources in Grafana, unfortunately without success.
Query 1(Influxdb) contains the measurement results with two foreign keys. Query 2(SQLite) contains primary key that points to FK1 and the description for FK1(Query 1).

Query 3(SQLite) contains primary key pointing to FK2 and the description for FK2(Query 1).

When I connect query 1 with query 2 via INNER JOIN and column GA it all works when query 1 has records.
image

image

Problem 1:
If query 1 has no records, then all records from query 2 are displayed.

It would be correct that no data records are displayed at all.
image

Problem 2:
When I join query 1 to query 2 using column GA and to query 3 using column PA and INNER JOIN, the second INNER JOIN is ignored.

What am I doing wrong?

Do you have a solution for problem 1 and problem 2?

Query 1
SELECT time, GA, PA, Val FROM /^$line$/ WHERE ("GA"::tag =~ /^$ga$/) AND ("PA"::tag =~ /^$pa$/) AND $timeFilter order by time desc limit 10

Query 2
Select GA, Name AS GA_TEXT From GA

Query 3
Select PA, Name AS PA_TEXT From PA

What did you expect to happen?

Problem 1:
It would be correct that no data records are displayed at all

Problem 2:

That INNER JOIN works

It would be correct that no data records are displayed at all

Did this work before?

no

How do we reproduce it?

see description above

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: Docker Version 11.0.0
OS: Debian
Browser: Google Chrome Version 124.0.6367.209

Grafana platform?

Docker

Datasource(s)?

Influx, SQLite

@leeoniya
Copy link
Contributor

we recently refactored INNER join in #87409

can you try an 11.1 nightly build and see if it works correctly now?

https://grafana.com/grafana/download/nightly?edition=oss

if that still doesnt work, maybe attach a debug dashboard for us to troubleshoot (it will embed the data, and you can sanitize it if necessary)

https://grafana.com/docs/grafana/latest/troubleshooting/send-panel-to-grafana-support/

@sensej-j
Copy link
Author

Hello,
Thank you for your recommendation.
Yesterday I tried to install the version grafana/grafana-oss-dev:11.1.0-178727 in Portainer, unfortunately without success. I get the same error message with the other grafana dev-versions.

image

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

No branches or pull requests

2 participants