Execute failed: org.knime.core.data.def.DoubleCell cannot be cast to org.knime.core.data.StringValue

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

Knime-Troubleshooting.knwf (50.3 KB)Dataset 1.zip (2.4 MB)
Dataset 2.zip (3.1 MB)

Hi 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.

Cheers,
Mischa

Just a theory…

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.

1 Like

Hi Mischa,

Actually the problem is with concat node.

The workflow is attached. Knime-Troubleshooting.knwf (50.3 KB)

Hi EvanB,

The problem is actually concatenate but I don’t know what exactly going wrong there. I think it is recognizing the data type correctly, but not sure.

Cheers,
Baran

Hi,

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).

Cheers,
Mischa

1 Like

Hi @Baran

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.

Hope this helps,
Temesgen

1 Like

Hi Mischa,
The dataset 1 and 2 which should be concatenated are attached.
Cheers,
Bahrak
Dataset 1.zip (2.4 MB)
Dataset 2.zip (3.1 MB)

Hi Temesgen,

I checked all columns of my two data sets. All columns are identical in their type. I uploaded the data sets.

Cheers,
Baharak

Hi Baharak,

All columns are identical in their type.

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)

Best,
Temesgen

2 Likes

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