null in dateparser (tmap)

Highlighted
Six Stars

null in dateparser (tmap)

Hi, 

i want to convert from string with this value "yyyy-MM-dd' 'HH:mm:ss" to date "yyyy-MM-dd' 'HH:mm:ss". but i have this error:

java.lang.NullPointerException
	at routines.system.FastDateParser$DateParser.parse(FastDateParser.java:127)
	at java.text.DateFormat.parse(Unknown Source)
	at routines.TalendDate.parseDate(TalendDate.java:928)
	at routines.TalendDate.parseDate(TalendDate.java:886)
	at ffh.ods_collecte_preparation_licence_info_1_0_1.ODS_Collecte_Preparation_licence_info_1.tDBInput_1Process(ODS_Collecte_Preparation_licence_info_1.java:4563)
	at ffh.ods_collecte_preparation_licence_info_1_0_1.ODS_Collecte_Preparation_licence_info_1.runJobInTOS(ODS_Collecte_Preparation_licence_info_1.java:7607)
	at ffh.ods_collecte_preparation_licence_info_1_0_1.ODS_Collecte_Preparation_licence_info_1.main(ODS_Collecte_Preparation_licence_info_1.java:7282)
Exception in component tMap_2 (ODS_Collecte_Preparation_licence_info_1)
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "null"
	at routines.TalendDate.parseDate(TalendDate.java:942)
	at routines.TalendDate.parseDate(TalendDate.java:886)
	at ffh.ods_collecte_preparation_licence_info_1_0_1.ODS_Collecte_Preparation_licence_info_1.tDBInput_1Process(ODS_Collecte_Preparation_licence_info_1.java:4563)
	at ffh.ods_collecte_preparation_licence_info_1_0_1.ODS_Collecte_Preparation_licence_info_1.runJobInTOS(ODS_Collecte_Preparation_licence_info_1.java:7607)
	at ffh.ods_collecte_preparation_licence_info_1_0_1.ODS_Collecte_Preparation_licence_info_1.main(ODS_Collecte_Preparation_licence_info_1.java:7282)
Caused by: java.text.ParseException: Unparseable date: "null"
	at java.text.DateFormat.parse(Unknown Source)
	at routines.TalendDate.parseDate(TalendDate.java:928)
	... 4 more

 

do you have a picture with my tmap Capture.PNGbest regards 

Employee

Re: null in dateparser (tmap)

Hi,

 

   Could you please remove the single quotes and parse the date?image.png

 

Relational.ISNULL(row2.data)? null:
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row2.data) 

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

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