Handling null values from a date column while passing it to context variable

Highlighted
Six Stars

Handling null values from a date column while passing it to context variable

Hi All,

 

I have a scenario where I am passing the max value from a source date column in to a context variable. But because the source date column has nulls in it, Im getting the below warning and this is causing the job to fail at later point of time.

 

Please help on how to handle nulls.

 

date.PNGdate1.PNG

Below is the message I get when I run the job.

 

[WARN ]: lmu_data_warehouse.hist_slate_data_ini_latest_0_1.HIST_SLATE_DATA_INI_LATEST - Null value will be used for context parameter max_decision_date: Unparseable date: " "

 

Thank You


Accepted Solutions
Employee

Re: Handling null values from a date column while passing it to context variable

Hi,

 

     Its not an error (I believe its coming from the previous job we had discussed). You can switch off the log4j to off or error mode as shown below to avoid it.

image.png

 

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


All Replies
Employee

Re: Handling null values from a date column while passing it to context variable

Hi,

 

     Its not an error (I believe its coming from the previous job we had discussed). You can switch off the log4j to off or error mode as shown below to avoid it.

image.png

 

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

Six Stars

Re: Handling null values from a date column while passing it to context variable

Hi Nikhil,

I followed the changes per your recommendation and still getting the error related to null.

 

Please find the screenshots below.

11.PNG12.PNG

 

Thank You

Employee

Re: Handling null values from a date column while passing it to context variable

Hi,

 

    This issue is different. I would recommend you to check the trowgenerator (from previous post) and check whether you have given values for all the areas. It seems you have not given value to one of those steps (most probably line count).

 

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

Six Stars

Re: Handling null values from a date column while passing it to context variable

Hi Nikhil,

 

Please find the screenshot below from tRowGenerator. I have followed exact same steps as per your previous post. 

 

The only difference is that in the "Number of Rows for RowGenerator"  section, I had to type ((Integer_globalMap.get("row5.INTERVAL")) manually as I was not getting the row5.INTERVAL column in the drop down which I used CTRL+SPACE.

 

Please suggest if Im missing anything.

 

1.PNG

 

Thank You

Six Stars

Re: Handling null values from a date column while passing it to context variable

Hi Nikhil,

For the sake of testing I just removed ((Integer)globalMap.get("row5.INTERVAL")) and input 100 over there and the job was running without throwing the error it used to earlier.

This shows there there is something wrong in the way I input the variable there. Please suggest where I went wrong.

 

The other observation was I killed the job to see how the data was populated to target table so far and observed that all nulls were being populated to the target. Please suggest.

 

2.PNG3.PNG

Employee

Re: Handling null values from a date column while passing it to context variable

Hi,

 

    Unfortunately I am in the middle of some other investigation. But to help you to progress, I am attaching the job I have created to test for your reference. I have used 7.2 version of Talend to create the job.

 

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

Employee

Re: Handling null values from a date column while passing it to context variable

Hi,

 

    Could you please check the schema is present correctly in tHashInput and tFlowtoIterate components? Most probably the interval column might be missing in your job. That is the reason it is not listing in drop down for tFlowtoIterate.  It should be something minor. You have the sample job and the hint. I am sure you can crack the issue now :-)

 

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

Six Stars

Re: Handling null values from a date column while passing it to context variable

Thanks Nikhil. I will look in to the schema if every thing is correct. Im not able to import the file you shared as Im on 7.1.1 version.

Six Stars

Re: Handling null values from a date column while passing it to context variable

Hi Nikhil,

 

This time I have replicated the same job you provided me in previous post including same sample data.

 

But im getting the same error on tRowGenerator component. This time I even got the variables in drop down when I used ctrl+space.

Not sure where Im going wrong please help.

 

5.PNG6.PNG7.PNG8.PNG

Employee

Re: Handling null values from a date column while passing it to context variable

Hi,

 

    Ideally the count column should be visible when you give a Control space. Could you please download a free version of 7.2 and use my attached job for reference?

 

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

Six Stars

Re: Handling null values from a date column while passing it to context variable

Hi Nikhil,

 

For some reason after the tconverttype component data was not being processed. I used tlogrow and got no records. 

 

So I converted the data in tmap itself rather than using tconverttype and the rest I followed your steps and acheived my result.

 

Thank you very very much for your help. 

Six Stars

Re: Handling null values from a date column while passing it to context variable

Hi Nikhil,

 

I did not check "Auto Cast" option in tconverttype earlier and hence that caused the problem.

 

My bad I over looked your screenshot.

 

Thanks again

Employee

Re: Handling null values from a date column while passing it to context variable

Perfect!

 

Could you please mark the topic as resolved?

 

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

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Talend API Services Publish to Talend Cloud

Learn how to publish your API Services to Talend Cloud

Watch Now

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now

Cloud Data Warehouse Trends for 2019

Find out aboutCloud Data Warehouse Trends for 2019

Read