I concatenated 2 data sets. In the 1st data set I have a column A with the type integer but in the 2nd set this column A is empty and thus identified as string. Unfortunately after the concatenation of the 2 data sets the column A has the type non-native [interface org.knime.core.data.DataValue] and thus I got an error message when I tried to write these data in a database table.
Is there a way to solve my issue perhaps to automatically get the column type integer for my column A (in my 2nd data set the column is empty and thus every column type would be fine) or can I set all the column of non-native type to string (the most generic type) after a concatenation.
Is non-native the default column type in case of type conflict in the concatenation node?
Thank you for your help and best regards,
Hi @claudeostermann , does your problem get resolved if you follow your Concatenation node with a Column Auto Type Cast node, and then take your dataflow from the upper output port. This node should rescan sample and try to re-determine the data types ?
No. From node description:
…if the column types differ the column type is the common base type of both input column types…
So Int and Double should result in Double while String + Numeric column should result in Non-Native.
Apart from above mentioned Column Auto Type Cast node which should convert your column A to integer you can check Table Validator (Reference) and Table Validator nodes. They can also convert your columns and make sure your table structure is as expected before any DB operation.
Thank you for the hint about the Column Auto Type Cast node. It perfectly fits my expectations.
I will also check the Table Validator (Reference) and Table Validator nodes.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.