Feature request: for the Ungroup node, provide option for removing rows with empty collections

Dear Knimers,

When ungrouping a row containing a Collection with 3 elements, I get 3 rows.
When ungrouping a row containing a Collection with 2 elements, I get 2 rows.
When ungrouping a row containing a Collection with 1 element, I get 1 row.
When ungrouping a row containing a Collection with 0 elements, I get… 1 row, with a missing value.

In some situations this is inconsistent behaviour. Yes I could remove the missing value row with a Row Filter or a Missing Value node, but then what about non-empty collections containing missing value elements? Therefore I suggest adding an option to the “Ungroup” node to remove rows with empty collections.

Best,
Aswin

Hi @Aswin -

Unless I’m missing something obvious - which is entirely possible - isn’t this case already handled by the Skip missing values checkbox in the Ungroup node? See attached workflow:

Ungroup_missings_example.knwf (9.3 KB)

Hi @ScottF

I was not referring to a Missing Value cell in a Collection column, I was referring to an empty Collection; i.e. a Collection with no elements. An empty Collection is not the same thing as a Missing Value. For example:
image

When I try to ungroup this, this happens (“Skip missing values” checkbox has no influence here):
image

The list with 1 element and the list with zero elements both yield 1 row in the final table. I think for the empty list zero rows would be make more sense in many cases.

“Now”, I hear you ask, “since the row that came from the empty list now contains a missing value, you can simply remove that row with a Row Filter or Missing Value node.” Yes, but what if some of the lists contain missing values that I want to keep? Extreme example:
image

Ungroup:
image

The Row Filter trick will not work here. (Amusing: when I check the “Skip missing value” checkbox here, I only get a single row from the Ungroup node: the line from the empty list, containing a Missing Value :smile: )

“A situation where this is a problem will be rare” one might think. Look at the following table where the two neighboring lists are “synchronized”; the lists are equally long and the elements match pairwise. This makes the missing values in the list very important:
image

Ungroup:
image

Best,
Aswin

KNIME_project2.knwf (13.5 KB)

1 Like

Hi there @Aswin,

tnx for detailed explanation. Ticket is created.

Br,
Ivan

2 Likes

Thanks Ivan!

(Also, reading through Aswin’s example, I had a good chuckle at “Friendzone Unlimited” :smile: )

2 Likes

With a name like that, it is no surprise that their customer Collections have zero elements :nerd_face:

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

Hi @Aswin,

this is implemented with 4.2.0 KNIME version :wink:
https://www.knime.com/changelog-v42
(AP-13272)

Br,
Ivan

2 Likes

Thanks @ipazin! :smiley:

Awesome release, 4.2! :rocket:

1 Like

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