Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
billxu
Contributor
Contributor

Talend is not generating "getBytes" for data type "byte[]"

Hello,

Could any body please help on this?

Situation:

  • Using Talend to fetch data from AS400
  • There're some columns having wrong character set settings in AS400
  • Fetching these columns by getString will get unreadable characters or meet a conversion fail error

What I am doing:

  • Edited schema to change the type of these columns from String to byte[]
  • Added auto conversion for converting byte[] to String (by calling a custom routine)
  • Expecting a getBytes call will be added when assigning value of these columns.

 

I expect that there will be a block of code like " rs_tDBInput_1.getBytes " generated by Talend.

But Talend only generates an "if" block with an empty "else" block.

Please refer the attached screenshot.

 

So are there any steps I missed when doing such schema customizing?

Or how to solve this kind of code generating problem?

 

Best regards

Bill

Labels (2)
10 Replies
billxu
Contributor
Contributor
Author

Many thanks to Talend's dev team.

This problem can be solved by just changing columns type to align with db type.

(1) There is no need to add a custom data type in mapping (in this case, I added a data type named "RAW" for java data type "byte[]"),

(2) and the columns type in schema should not be configured with types not in default mapping (in this case, "RAW" is not in default mapping).

(3) Otherwise, tDBInput won't recognize the data type correctly and won't generate codes for it. (in this case, custom added "RAW" is not recognized by tAS400DBInput, so that tAS400DBInput doesn't know which getter shall be used for it, and leaves blank only)

 

Best regards,

Bill XU