Merging collections of doubles creates a collection of Strings!?

Hello,

 

When using the GroupBy node to merge multiple cells into one - I'm trying to combine all the elements of some Double-type collection cells into one cell with a large collection of Doubles.  I'm using the "List" group type.

 

Yet I get a mixed cell type which Java snippets treat as "Strings" rather than an array of Doubles.

 

I'd rather not "ungroup" all these collections into separate cells then re-group them as it's rather slow.  I've had to resort to using a global variable "hack" in a java snippet to combine them instead, but it seems that's a rather specialised solution.  Any better ways of doing this?

 

Ed.

1 Like

Hi,

if the column that you group already contains collection cells the List operation will generate a collection of collection cells. I guess what you are looking for is the Union operation which creates a collection cell that contains the union of all (double) cells of the original collections.

Bye,

Tobias

Tobias,

I'm looking not for a collection of collections, but a collection of all the "primitive" values.

So, if I've got 30 rows each with 30 values, I want as output - one cell with a collection of 900 values, as opposed to a collection containing 30 arrays.

Union won't do this for me as I have duplicate values, and the List operator as you said creates the collection of collections.

Ed.

1 Like

I think I was also missing the flatten operation previously, but cannot find that discussion. As I remember that was not considered important, as you can expand the columns you want to merge individually and combine them again, but my memory can fail me in this regard. Anyway, that seems like a feasible workaround.