Hi! I’m trying to perform a join operation on named tuples with key-value pairs, where only the id key is supposed to be the join key. However, the whole tuple is being treated as the join key. The following code results in the error below:
Removing the keys ([id: "a", foo: 1] > ["a", 1]) seems to do the trick, but I was wondering if there is a way to join named tuples directly without stripping the names and then reconstructing after the join the original key-value pairs.
Hi Marcel, thanks for the help! This definitely looks much cleaner than the workaround I had in mind.
While we’re on the topic, do you think it would be useful for Nextflow to support joins between associative arrays or dictionaries (I have mistakenly referred to these as named tuples above) using a user-defined key as the join key? Are there any potential drawbacks to this approach that I could be missing?
Do you think it would be useful for Nextflow to support joins between associative arrays or dictionaries (I have mistakenly referred to these as named tuples above) using a user-defined key as the join key?
I think so, yes. I don’t really see any drawback and I think it would be a nice addition to the operators toolbox.