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.

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 2

Part 2 of a series on Context Variables

Blog

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