Channel join behaving in surprising (incorrect?) ways #1975
Replies: 4 comments 1 reply
-
I agree it is unintuitive. Here's a workaround: def inner_join(ch_a, ch_b) {
return ch_b.cross(ch_a).map { [it[0][0], *it[1][1..-1], *it[0][1..-1]] }
}
left = Channel.from(
['k1', 'l1', 'l1'],
['k1', 'l2', 'l2'],
['k2', 'l3', 'l3']
)
right = Channel.from(
['k1', 'r1', 'r1'],
['k2', 'r2', 'r2']
)
inner_join(left, right).view() Note that because |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
I also think there should be an option to replicate the values instead of using |
Beta Was this translation helpful? Give feedback.
-
The left = Channel.of(
['k1', 'l1'],
['k1', 'l2'],
['k2', 'l3']
)
right = Channel.of(
['k1', 'r1'],
['k2', 'r2']
)
left.combine(right, by: 0).view() |
Beta Was this translation helpful? Give feedback.
-
join
seems to drop duplicate keys, and gives inconsistent results when used withremainder: true
.There's a similar (stale) issue which I don't think got to the core of the problem, which is not about outer vs inner join.
Given this code:
I get this output:
while I would have expected this:
The result of using 'remainder: true' is even more puzzling. This code:
results into this:
The same behavior is shown by the 'cross' operator.
Beta Was this translation helpful? Give feedback.
All reactions