Hi everyone,
I am using Knime 4.0.0. In my workflow, I transform one variable from double to an integer with Double to Int node. Then I do this for two datasets and then combine them with a concatenate node. The node works fine but I get the error “Execute failed: org.knime.core.data.def.DoubleCell cannot be cast to org.knime.core.data.StringValue” later on in a for loop that I am using to define new variables in my time series data. This error happened after updating the software. I appreciate it if anyone can give me any advice.
Cheers,
Baran
could you share the workflow with the data? The reason is that the failure seems happens in the R-snippet code and it would be useful to see what data gets in and what the node does with it.
Double check that the concatenate is correctly aligning each data type in the columns first before your math node. If Knime recognizes one as a string and the other as a decimal, it will give you a “?” type on concatenate. If one is a “?” type, use Column Rename to change it to String, then String to X to change it to the appropriate data type.
as said, we need not only the workflow, but also the data. Your data is located seemingly outside of the workflow and the reader nodes are not saved in executed state. Without the data it is not possible to see what exactly goes wrong. If the data is sensitive, then please reproduce the same issue with dummy data (using Data Generator or Table Creator for example).
According to the description of the Concatenate node:
if the column types differ the column type is the common base type of both input column types
That is the main reason the R Snippet node is failing. You have one column coming from two sources with different types (I guess, one String and another Decimal). This creates a problem for the R Snippet node. See the attached simplified example. R-problem-after-concat.knwf (17.1 KB)
In the example workflow, there is also a suggested solution (i.e., making sure the types match).
The reason the loop was failing only later was b/c most of the values were empty. the conversion was not needed until the 100th or some iteration.
That is not simply true. The column TrackObjects_MergeScore has a Number (double) type in the first dataset and String type in the second one. KNIME auto detects the types from the values contained in the column. In this case 0.488 and “nan” for the first and second datasets respectively.
Please find attached the fixed workflow. I converted the TrackObjects_MergeScore column from the first dataset to string to make it compatible with that of the second (yellow box). knime-Troubleshooting-fix.knwf (54.2 KB)