Tfilter advanced mode - java.lang.NullPointerException

Seven Stars

Tfilter advanced mode - java.lang.NullPointerException

Hi all,

I've officially hit the point where I don't have any more ideas in trying to figure my tfilter advanced mode syntax and looking to the community to help me out in getting this accurate.

I have 3 conditions that are working fine, however, I learned that I have to add more.

My current conditions are this:

(input_row.FROMNAME != null ) || (input_row.TONAME != null ) || !(input_row.DESCRIPTION.isEmpty())

Therefore, I'm accurately filtering out the nulls for FROMNAME and TONAME and then blanks for DESCRIPTION.

 

Here is my job design, it does have a tExtractJSON component that a colleague worked on for this job.

https://www.screencast.com/t/7By21UZ9Jhlr

 

I have 3 rows left in my data set that I have to also filter out.  The snapshot link below are the 3 rows that have to be filtered out.

https://www.screencast.com/t/hiBDnSxI

 

I tried adding more conditions to my existing tfilter advanced mode, but I'm getting the good ol' ...' java.lang.NullPointerException' error.  All indications show that the FROMNAME and TONAME are blank strings.  

 

Can anyone provide the java syntax to remove these 3 rows? 

Or provide any more suggestions on additional steps to take to make sure that my FROMMANE and TONAME values are blank strings?

 

Please anyone help to shed any light that you can so I can get on with my life.  ha!

Thanks much!

Michelle

 

 

 

 

Community Manager

Re: Tfilter advanced mode - java.lang.NullPointerException

You said you are trying to add more condition, what is the condition that cause the NullPointerException?
----------------------------------------------------------
Talend | Data Agility for Modern Business
Seven Stars

Re: Tfilter advanced mode - java.lang.NullPointerException

Hi there shong, 

Thanks for reach out, I guess I should have included that part in my post.

 

Here are the conditions I am trying to add in the advanced mode in tfitler:

 

||

!(input_row.FROMNAME.isEmpty())

||
!(input_row.TONAME.isEmpty())

 

So trying to add 2 more conditions to remove those blank fields for the FROMNAME and the TONAME.

 

 

 

Community Manager

Re: Tfilter advanced mode - java.lang.NullPointerException

Your filtering is not correct. You say....

 

"I have 3 conditions that are working fine, however, I learned that I have to add more.

My current conditions are this:

(input_row.FROMNAME != null ) || (input_row.TONAME != null ) || !(input_row.DESCRIPTION.isEmpty())

Therefore, I'm accurately filtering out the nulls for FROMNAME and TONAME and then blanks for DESCRIPTION"

 

You are using an OR operator. So this condition will be met if FROMNAME is not null OR TONAME is not null OR DESCRIPTION is empty (should also be not null). I think you need to use the AND operator (&&)

Seven Stars

Re: Tfilter advanced mode - java.lang.NullPointerException

Thanks rhall, 

I have also tried the && operator, but I've tried so many different iterations, that I may have lost track.

Let me play with that and see if I can get my final extract as expected.

Thanks for the reply!.

Michelle

 

Community Manager

Re: Tfilter advanced mode - java.lang.NullPointerException

Also try changing the DESCRIPTION filter to !=null

Seven Stars

Re: Tfilter advanced mode - java.lang.NullPointerException

Ok will do thank you.  Smiley Very Happy

Six Stars

Re: Tfilter advanced mode - java.lang.NullPointerException

Try like this

 

((!Relational.ISNULL(input_row.FROMNAME)) || (!Relational.ISNULL(input_row.TONAME))|| (!(Relational.ISNULL(input_row.DESCRIPTION) || input_row.DESCRIPTION.equals(""))))

 

If this is what you are looking for then, Press the "Accept as Solution " Button.

Thanks,
AR

Seven Stars

Re: Tfilter advanced mode - java.lang.NullPointerException

Thanks for the suggestion, but I'm still getting the 3 blank rows.

Employee

Re: Tfilter advanced mode - java.lang.NullPointerException

Hi,

 

     Did you check whether the incoming data is null or empty string? I guess your incoming data is coming as empty string.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Seven Stars

Re: Tfilter advanced mode - java.lang.NullPointerException

In the raw data, it appears to be empty.

Employee

Re: Tfilter advanced mode - java.lang.NullPointerException

Hi,

 

   Please use the below sample condition to verify the data.

 

Relational.ISNULL(row8.columnValue) ? "null value" :row8.columnValue.equals("")? "empty string": row8.columnValue 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

 

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog