Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm facing a problem when using tSchemaComplianceCheck component to validate incoming date/time.
The data comes in the format "yyyy-MM-dd'T'HH:mm:ssXXX", for example "2019-10-02T21:45:33+01:00".
Schema check fails with the message "wrong DATE pattern or wrong DATE data"
However, when I'm parsing the same date using the same format, it's working without any issues:
TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ssXXX",... )
I have tried setting "Ignore TimeZone when check date" without any effect.
Using Talend Open Studio for Data Integration, v7.1.1
Any ideas?
Thanks,
Rimvis
It appears that there is a check box called Use Strict Date Check (in Advanced settings). Validation is working correctly under UTC if this check box is enabled.
Hi,
If its not working for tSchemaComplianceCheck component alone, could you please create a feature request using JIRA?
The interim feature will be to parse it using date parse function and catch any error and convert it to yes or no flag for rejection.
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
Thanks @nthampi
At the moment I'm just trying to understand, if I'm doing something wrong, or the component does not support date formats with timezone (XXX) at all. I'm happy to raise a feature request if this is the case.
Thanks,
Rimvis
Hi Rimvis,
Apologies for the confusion. Just now I checked it again.
You can definitely check the results for this format. You need to read the data as String and do the date check in tSchemaComplainceCheck component as shown below.
If the data is correct, it will be transferred to the main output as shown below.
If the data is wrong, it will be transferred to Reject flow as shown below.
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
Hi @nthampi ,
It appears that the problem exists only if local time zone is set to UTC. It works as expected under other time settings.
Do you know if there is any workaround for that? Without changing the time settings that is
Thanks,
Rimvis
Hi,
Could you please share a sample value you are using and the error you are getting with screenshots?
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
Hi @nthampi ,
It's the same value: "2019-10-02T21:45:33+01:00"
The error: wrong DATE pattern or wrong DATE data
Here's screenshot with time zone set to UTC+2 (Helsinki , ...)
And here's with UTC:
I'm attaching my sample job as well.
Thanks,
Rimvis
Hi,
I could not understand any difference between 2 screenshots. I was able to run your job with the data you have given in the sample 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
Hi @nthampi ,
In the first screenshot record is validated, and it goes to Main output (Check OK)
In the second screenshot validation fails, and the record goes into Rejects (Check Failed)
All I did between those runs is changed time zone to UTC.
Are you saying it runs OK for you in UTC time zone?
Thanks,
Rimvis
Hi,
I could not see any difference in the values in both screenshots. Where are you changing the UTC time zone?
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