Five Stars

tHashInput fails Type mismatch: cannot convert string to date. using SalesForce source

Recently, I found an existing job began to fail due to the use of a deprecated salesforce API version being used in my Talend job.

 

I've since updated Talend Studio to 6.4.1 and am using version 39 of SalesForce API. I retrieved the schema to update the field definitions etc. Unfortunately I am now receiving a type mismatch error in the tHashInput action. The action is consuming SalesForce Contact object. Initially, I had a very large number of type mismatch errors, and I began reducing the number of fields "used" in the action. I was able to narrow down a specific example to post here for some guidance. 

 

"CreatedDate" and "LastModifiedDate" are system fields in SalesForce within the Contact object. The schema correctly classifies these fields as date fields with a date pattern. If these fields are included in the tHashInput action, I receive the error "Type mismatch: cannot convert from String to Date" for each of these fields. What gives? I've spent hours trying various things to resolve and I've officially hit a wall. Please help!

 

 

5 REPLIES
Twelve Stars TRF
Twelve Stars

Re: tHashInput fails Type mismatch: cannot convert string to date. using SalesForce source

Hi,
What's the datatype for these fields in the associated tHashOutput component which, I suppose, is connected to the tSalesforceInput?
Probably String.
Also an other Double field you try to match to a String.

TRF
Five Stars

Re: tHashInput fails Type mismatch: cannot convert string to date. using SalesForce source

Hi TRF, 

If you look at the attached screenshot, the column is selected to be Date with a Date Pattern defined.  The tHashInput/Output is fed into a tMap. If you look at the original screenshot attached to this post, you can see that the error is occurring directly on the tHashInput action. 

 

I did not follow your comment "Also an other Double field you try to match to a String". Can you clarify? Thanks!

Twelve Stars TRF
Twelve Stars

Re: tHashInput fails Type mismatch: cannot convert string to date. using SalesForce source

Double check schemas are aligned for tSalesforceInput, tHashOutput and tHashInput. I can't try now, but I'm almost sure the problem comes from here.
As shown by the error message, you got the problem for 3 fields, not only the 2 you mentionned.

TRF
Five Stars

Re: tHashInput fails Type mismatch: cannot convert string to date. using SalesForce source

Yes, I'm having difficult with other fields as well, but wanted to at least focus on these two fields first and hopefully the root cause for all fields is the same.  As you can see from the tSalesforceInput action, the field definition is Date with the same date pattern. 

 

2017-12-06_17-43-27.jpg

Twelve Stars TRF
Twelve Stars

Re: tHashInput fails Type mismatch: cannot convert string to date. using SalesForce source

Hi,

I have tried just now, it works fine.

So, I think the problem you have is due to a desynchronization between your tHashOutput and tHashInputSchema.

Capture.PNGCapture.PNGCapture.PNG


TRF