Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Exception in component tMap_3 (pcrfvspgwsmalldata)
java.lang.NullPointerException
at newproj.pcrfvspgwsmalldata_0_1.pcrfvspgwsmalldata.tFileInputDelimited_4Process(pcrfvspgwsmalldata.java:3903)
at newproj.pcrfvspgwsmalldata_0_1.pcrfvspgwsmalldata.runJobInTOS(pcrfvspgwsmalldata.java:7434)
at newproj.pcrfvspgwsmalldata_0_1.pcrfvspgwsmalldata.main(pcrfvspgwsmalldata.java:7283)
Lines from the code:
Var.Variance = row6.Sum - row4.Diff;// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
tFileInputDelimited_4Process(globalMap);
int exitCode = pcrfvspgwsmalldataClass.runJobInTOS(args);
The tmap function is doing a join between two data sets and difference between values of two columns
Hi, maybe row6.Sum or row4.Diff have null value.You have to make it null safe
Send me Love and kudos
Sum and Diff columns are float type. How do I make them null safe?
use Float instead of float
check null value for each and if one of them is null, reject it or pass a null value instead of the difference
(row6.Sum == null || row4.Diff == null)?null:row6.Sum - row4.Diff;
float are not good for precision , you'll better use other type like bigDecimal for example.
Thanks so much. This removed the error.
But I want the output like 6-null=6,
similarly, null-6=-6
null should be replaced with 0 in row6.Sum and row4.Diff
(row6.Sum ==null?0F:row6.Sum)-(row4.Diff==null?0F:row4.Diff);
Thanks . I was doing the same thing but with 0 not 0F. That was obviously giving type mismatch errors.
0f ,0F, new float(0),new Float(0) can work
Is there a way to pivot total of values in Talend.
For example, for 'ID' cloumn that has XX123, XX123 entries, I want sum of all values in column 'Volume' pertaining to XX123 ID.
Excel attached