File Reader Unable to set Column Type using Flow variables

In File Reader Config dialog, one can set the Column Properties like Name and Type by double clicking the column header in Preview. I was trying to achieve the same using flow variables.

I am able to set column name on Flow Variables tab using the following navigation path
ColumnProperties → <column number, e.g. 0> → Column Class → ColumnName

However, similar attempt to set Column Type did not work. I tried the following navigation path:
ColumnProperties → <column number, e.g. 0> → Column Class → ColumnName → ColumnClass → CellClass

And tried using a flow variable value “String”, and also some more variations but none worked.

File Reader shows the following error:
Errors loading flow variables into node : Data cell implementation ‘String’ not found

Would appreciate if some one can share a sample workflow that shows how to set Column Types in file reader using flow variables, Thanks!

Small corrections in the navigation paths mentioned in my query above:
For ColumnName I used this and it worked:
ColumnProperties → <column number, e.g. 0> → ColumnName

For Column Type I tried the following path but it gave this error: Errors loading flow variables into node : Data cell implementation ‘String’ not found
ColumnProperties → <column number, e.g. 0> → ColumnClass → CellClass

Also attaching a screenshot of Flow Variables dialog for File Reader.

Welcome to the forum.

If you want to set the type of column 0 to string, then the flow variable needs to have the value org.knime.core.data.def.StringCell.

Integer would be org.knime.core.data.def.IntCell, double floating point number would be org.knime.core.data.def.DoubleCell, etc.

You can see the required variable values if you export the variable. Configure the node manually, then add a variable name in the textbox to the right of the dropdown menu of the appropriate variable name. Execute the node and examine the flow vairables tab:

image

image

4 Likes

I tried it and it works. Thanks a lot!

2 Likes

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