3

I am using Mixed data sources

I used two postgres databases, created two queries

In transform section, used Join by field => Mode as Inner join. But it is returning only one row instead of many-to-many join

Query1 result

user_id, name
1,abc
2,def

Query2 result

order_id,user_id
1,1
2,1

Transform result

user_id,order_id,name
1,2,abc

Expected transform result

user_id,order_id,name
1,1,abc
1,2,abc

Is many-to-many or many-to-one join not possible in Grafana?

Thanks in advance!

3
  • 2
    I'm afraid this is not supported. My understanding is that field used in join expected to be unique within every query result.
    – markalex
    Commented Apr 23, 2023 at 17:23
  • Can you put this to answer ? i will mark as close
    – Yusuf
    Commented Apr 24, 2023 at 6:48
  • @markalex - do you know any such open-source tool with this capability except looker ?
    – Yusuf
    Commented Apr 24, 2023 at 6:49

1 Answer 1

1

I'm afraid this is not supported.

My understanding is that field used in join expected to be unique within every query result.

Since joins are more of RDBMS task I would suggest investigate possibility of using Postgres to its fullest. Looking into dblinks, this way you'll get native sql joining capabilities.

2
  • dblinks are slow, afaik after reading various questions on SO, articles, etc
    – Yusuf
    Commented Apr 24, 2023 at 11:20
  • 1
    @Yusuf, yes they can be slow. But if you request small amount of data to be processed you shouldn't notice it. Also, I believe it still will be faster that alternative intermediate solutions, like mentioned looker.
    – markalex
    Commented Apr 24, 2023 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.