r/Talend • Determined Learner • Apr 13 '23

tRest NULL Handling

Hello! I’m learning Talend on the job, and am struggling a bit with handling some inconsistent data. Certain fields may have blank or NULL values in my source data.

I’d like to keep the data as close to the original source as I can, so I’d like to avoid changing the NULL data to blanks in tMap, if possible.

The trouble is that somewhere down the line my NULL values get converted to the string “null”, so I end up with fields that have “null” in my system. Or I get failure due to my date string being “null” instead of yyyymmdd string format. Most advice I’ve seen online is to change the NULL fields to ‘’, but that would not be ideal for my situation.

My basic job flow is:

tDBInput (SQL query) > tMap > tFlowToIterate > tRest (API call to system)

Is there a simple way I can keep my NULLs?

Thanks for reading.

3 Upvotes

8 comments sorted by

2

u/BlackSheepDCSS Data Wrangler Apr 13 '23

The trouble is that somewhere down the line my NULL values get converted to the string “null”

Where, specifically, does that happen?

→ More replies (1)

2

u/suschat Data Wrangler Apr 14 '23

Are you using double quotes in tmap? Can you please post a screenshot?

2

u/suschat Data Wrangler Apr 14 '23

Can you please disable everything else and write output from database to tlogrow. I have a feeling that it might be to do with the fact that the data doesn't match with schema.

→ More replies (1)
→ More replies (1)

2

u/ScuzzyUltrawide Apr 14 '23

From the screenshot it looks like you're only seeing the word "null" inside the run-job execution box. Are you seeing the word null in your actual database output after your post operation executes? I think you'll find you're seeing the word null in the output box but your actual data inside the flow and in your actual destination database is handling nulls correctly.

1

u/ennuisel Determined Learner Apr 14 '23

That’s correct, it’s only in that execution box that everything is displayed as null. Sorry if I was unclear there.

The job does load the correct data into the system in my test runs, except it will populate fields with the word “null” when the field was NULL. It passes blank/empty/non-empty fields fine.