Feature suggestion: Dictionary/Hastable/HashMap type

Dear Knimers,

In my workflow I make extensive use of the List type to efficiently store large chunks of numbers. But I have been thinking that it would be awesome to also have in Knime something like a Dictionary (Python) or Hashtable/HashMap (Java).

It could work as follows. Suppose I have some columns and I want to combine them using the Column Aggregator node. By combining them into a Dictionary, the values in the columns could be combined with the column headers as keys. Calling Split Collection Column on the Dictionary, the keys could become column headers again. Similarly, by combining the values in a single column into a Dictionary using the GroupBy node, the keys could be the row IDs.

Simultaneously ungrouping multiple dictionaries in neighboring columns could work like a “join” on the dictionaries; knime could automatically make sure that the keys line up and that empty values are created when a key is present in one dictionary but not the other. This would be much safer than simultaneously ungrouping two neighboring lists and pray that I did not accidentally mess up up the ordering along the way.

Best,
Aswin

1 Like

Hi @Aswin,

this sounds reasonable. And we will add it to the internal ticketing system. This will require not only adding the new type but extra work around it to make it useful in other nodes. This will be most likely a long-term project and there is interest to contribute we always welcome extensions :slight_smile:

Best regards,
Mischa

2 Likes

Dear @lisovyi,

no doubt it would be a lot of work, I see that the Java HashMap is not a List subclass… :grimacing: Still, something like a HashMap would be a nice complement to Knime’s current features, so I thought let’s just put the idea out there.

Best
Aswin

3 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.