how to express absolute value in advanced settings in tFilter

One Star

how to express absolute value in advanced settings in tFilter

Hi, all
I want to construct a filter condition under advanced settings in tFilter. The condition is like:
for column1(type: BigDecimal) in Row2, if absolute value of column1 <=1 and column1 !=0. Could anyone help me to write this expression under advanced settings in tFilter?
Thanks a lot!
One Star

Re: how to express absolute value in advanced settings in tFilter

Hi
Because of BigDecimal type, the java code should type like this.
(input_row.columnName1.abs()).doubleValue()<3&&(input_row.columnName1.abs()).doubleValue()!=0

Hope this will help you.
Best regards!
Pedro
One Star

Re: how to express absolute value in advanced settings in tFilter

Hi,
When I tried to write the condition in the above format, I get the error as:
Exception in component tFilterRow_3
java.lang.NullPointerException
at talend_ccs.omega_generatepricetable_0_1.Omega_GeneratePriceTable.tPostgresqlInput_2Process(Omega_GeneratePriceTable.java:7942)
at talend_ccs.omega_generatepricetable_0_1.Omega_GeneratePriceTable.runJobInTOS(Omega_GeneratePriceTable.java:12677)
at talend_ccs.omega_generatepricetable_0_1.Omega_GeneratePriceTable.main(Omega_GeneratePriceTable.java:12545)
Any suggestions?
Thanks!
One Star

Re: how to express absolute value in advanced settings in tFilter

Hi
Please recheck tPostgresqlInput.
I'm afraid there is something wrong of your input flow.
Or upload the screenshot of your job and schema of tPostgresqlInput.
Best regards!
Pedro