Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello
I have a simple tmap
As an input I have csv file with 4 columns:
The last 2 colums are INT and INTEGER.
I'm not sure of the difference; anyway here, INT can not be null as you can see below (nullable box is no checked)
As an output, these last 2 colmuns are a string-type.
for the colmun which is an INTEGER, in the tmap I hve this
row3.code2==null?null: row3.code2.toString()
it's OK
But for the column which is an INT (non nullable), still want to make sure that if is null; then i have a null value so I alos do this:
row3.code1==null?null: row3.code1.toString()
but in this case I have 2 errors because talend told me i can't use toString() with int and I can't use "==" with int.
So I tried row3.code2==null?null: String.valueOf(row3.code2)
Now I have one error because talend told me i can't use "==" with int.
what can i do if I I still want to test whetehr code 1 is null or not.
Hi @android devops
The int data type is a primitive data type that is not instantiated from a Java class, unlike Integer. Therefore, it cannot hold a null value.
If we are discussing a tMap lookup table using a left join, by default, any int column from this table that does not match with the main row will become 0. However, since you are attempting to validate an int column from the main row, the situation is not as straightforward.
So, when you are dealing with the int data type and need to implement this type of validation, I suggest considering the following:
Hi @android devops
The int data type is a primitive data type that is not instantiated from a Java class, unlike Integer. Therefore, it cannot hold a null value.
If we are discussing a tMap lookup table using a left join, by default, any int column from this table that does not match with the main row will become 0. However, since you are attempting to validate an int column from the main row, the situation is not as straightforward.
So, when you are dealing with the int data type and need to implement this type of validation, I suggest considering the following:
thanks a lot