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
Transformations: Implement proper outer join #26316
Comments
@dprokop can you look at this? 🙂 |
I'm not 100% sure if this is by design. But looking at the provided example I think it looks correct, meaning that Grafana's result is probably off. @mckn do you have any thoughts on this? |
But refer to this page. In an outer join, unmatched rows in one or both tables can be returned. And the current result only returned joined rows |
@F4ncyMooN so the current implementation of |
I have used
|
@F4ncyMooN that sounds awesome! Can you reference that PR here? |
This does not explain why the join is wrong, does not show what join results in. Your example looks wrong, the expected output looks incorrect. |
Sorry I missed this line
This transform was mainly built to transform time series to a combined table. So does not handle duplicate join keys (ie rows with same join id in a source table) |
Got hit by the same issue. Trying to do an outer join on something like the following two tables on the
I believe the expected result of an actual outer join is:
The actual result is:
Rather than an outer join, the result appears to be either a left or right join (not sure how the sequence of tables is considered), and/or a reduce on the field which is used for the join. |
I’m experiencing the same behavior. |
The problem is the current join does not support duplicate rows (based on key filed) in each source table |
In my opinion, I would leave the current transformation (maybe rename it to something like single join) as it may be useful in some cases, but add a new left join transformation that supports multiple rows. |
I ran into the same issue. Two different ElasticSearch Datasources ... Datasource 2: metadata my intention: show workflow data with additional metadata Transformations: Rename by regex to create a unique column name ... Expected: one to many (1:n) matching Found: 1:1 matching and resulting missing rows I'm very interested in this feature ! |
I ran into the same "tricky" behavior of the "outer join" transformation, it does not work properly when the table to join has several rows on the "field" used to join. I found a workaround while waiting for the fix, here goes:
WITH fake_table_join AS (
SELECT split_part(user_email, ':', 1) as user_id, split_part(user_email, ':', 2) as email
FROM (VALUES ${mapping_userid_email:raw}) AS fake_table(user_email)
)
SELECT your_table.*, fake_table_join.email
FROM your_table
LEFT JOIN fake_table_join ON your_table.user_id = fake_table_join.user_id Of course, workaround works pretty well if you don't have a huge volume of data in your query variable (as Grafana loads all the values in memory for this variable) |
@noleto thanks for sharing the workaround. Unfortunately for my use case I'm trying to do the join on some Influx data, and since Influx isn't a relational database I don't think it's applicable. I thought I'd share that in case you (or anyone) might have relevant suggestions for a context like that. |
Is the issue highlighted by @F4ncyMooN on 14 July 202 is fixed ? |
I believe this was fixed by #72176 If your use case is not supported, feel free to comment on this issue with what is missing and we can figure out if we're needing a separate, more specific ticket or not. |
What happened:
When I use outer join transformer to calculate for the many to one case, I found the result is not expected.
For example, we have two data frames to join.
First is,
Second is,
Joined result only show 1 row, but I think the following result is correct.
What you expected to happen:
Now the join function only show the first row.
How to reproduce it (as minimally and precisely as possible):
As above
Anything else we need to know?:
I found many other transformation functions rely on this join function in seriesToColumns.ts.
Is it expected or just a bug?
Environment:
The text was updated successfully, but these errors were encountered: