Constant Value Column: Support more data types

Hi,

I was disappointed to notice that the Constant Value Column Node only supports the most basic data types but i.e. not collections (list / set).

image

Henceforth, I’d like to suggest extending support for more data types … like Path, URI, Collections and more.

Best
Mike

I like the idea. But I have a different perspective to reach the same goal.

I was thinking that adding various types to this node might be a bit complex from a development perspective because we can only:

  1. Input a string by keyboard.
  2. Adding other types would essentially mean converting the string to other types (and various conversion errors might occur during this process).
  3. Then convert this value into an entire column.

Step 2, in particular, can be somewhat troublesome.

I’m considering that our goal is simply to add an entire column with various type of constant content. So, we could actually have another node, perhaps called Select Value to Constant Column. This node could select an element from a specific row in a specific column of the input table (defaulting to the first row of that column) and then expand this element into a constant column.

or just add select value option to this node, then we can select or type value for simple types.

From a code development logic standpoint, this approach might be easier and less error-prone because the type conversion issues are already resolved in the previous node, and we just need to select an element and expand it.

1 Like

Hi,

the node is on the (extended) list of nodes we want to migrate to a modern dialog.

Since its input is actually almost identical to the Row Filter reference value input (minus the String case matching, which does not make sense here) there are is code re-use possible which helps to get this node migrated in the near future, too.

Converting a single value to a column is quite easy from a code perspective.

And also it is already possible in KNIME: if you already have a table with a single cell, you can just use the Cross Joiner to append the cell as a new column:

The Group By could also be a Row Filter followed by a Column Filter, or a Table Cropper, etc, or whatever is returning you a single cell that you want to append as a column.

3 Likes

Hi, @hotzm

Thank you for your explanation.

There are indeed many ways to do the same thing in KNIME. In fact, in addition to the Group By you mentioned, there are other ways to accomplish the same task.

As a user, what we actually want is to use the fewest nodes to complete the same work. This is the source of my idea of ​​selecting certain rows and columns as Constant Columns. Logically, I think they are the same thing.

However, I respect your decision.

BR,