Talend isDate function generating a java.lang.Error on yyyyMMdd form

One Star

Talend isDate function generating a java.lang.Error on yyyyMMdd form

I am attempting to use the isDate function in an expression for a incoming 8 character date string to see if it is a valid date or not. The date is in a ?yyyymmdd? format. The expression I am using is as follows: TalendDate.isDate(row1.OPTOUT_DATE,"yyyyMMdd") == true ? TalendDate.parseDate("yyyy-MM-dd",row1.OPTOUT_DATE):null. I am using the Test functionality in Expression Builder to ensure the logic works. It does if I change the date format to ?yyyy-MM-dd?, but not ?yyyyMMdd?. Test window in Expression builder displays the following error when I a date such as 20130906 as a value for the OPTOUT_DATE variable: Exception in thread "main" java.lang.Error: Unresolved compilation problems: . Has anyone encountered this issue before and do you have a resolution or workaround I can use in Talend Expression Builder.
Five Stars

Re: Talend isDate function generating a java.lang.Error on yyyyMMdd form

Shouldn't the formats that you're passing to isDate and parseDate be the same?
Seven Stars

Re: Talend isDate function generating a java.lang.Error on yyyyMMdd form

And don't trust the Test window in Expression builder. Best way is to look at the whole generated Code or run the job.

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now