Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
hzhen
Contributor III
Contributor III

Component cannot input complex Record

Thanks.​

A complex Talend Record (for example, the Record is stored in the A field of InputRecord) is no longer recorded when input as Input of the component developed by TCK (it became "Null", Talend The components provided by are fine).

​

For example, use talend component kit to create a simple Input Component (ObjectInput).

​

sources :

--------------------------------------------------------------------------------

@Documentation(

"TODO fill the documentation for this source"

)

public

class

ObjectInputSource

implements

Serializable {

private

final

ObjectInputMapperConfiguration configuration;

private

final

Demo3ComponentService service;

​

private

int

index =

0

;

​

public

ObjectInputSource(@Option(

"configuration"

)

final

ObjectInputMapperConfiguration configuration,

final

Demo3ComponentService service) {

this

.configuration = configuration;

this

.service = service;

}

​

@PostConstruct

public

void

init() {

index =

0

;

}

​

@Producer

public

ObjectInputRecord next() {

if

(index >

0

) {

return

null

;

}

​

index++;

​

ObjectInputRecord obj =

new

ObjectInputRecord();

obj.setAge(

35

);

obj.setName(

"ObjectInputRecord"

);

obj.setMarried(

true

);

ObjConfiguration sub =

new

ObjConfiguration();

sub.setObjName(

"sub name"

);

obj.setObj(sub);

System.out.println(obj);

return

obj;

}

​

@PreDestroy

public

void

release() {

}

}

--------------------------------------------------------------------------------

Among them, the definition of ObjectInputRecord is as follows:

--------------------------------------------------------------------------------

// this is the pojo which will be used to represent your data

public

class

ObjectInputRecord

implements

Serializable {

private

static

final

long

serialVersionUID =

1L

;

​

private

String name;

private

int

age;

private

ObjConfiguration obj;

private

boolean

married;

​

}

​

public

class

ObjConfiguration

implements

Serializable {

private

static

final

long

serialVersionUID =

1L

;

​

private

String objName;

}

--------------------------------------------------------------------------------

Read the same content with different Components (Custom Component and the original Component of TOS DI) and output the information using System.out.println.

​

>

the original

Component

===============================================

com.dhc.wuxd.talend.demo.demo3.source.ObjectInputRecord@5ca17ab0

in tJavaRow: row1.obj = {objName=sub name}

in tJavaRow: row1.name = ObjectInputRecord

in tJavaRow: row1.age = 35.0

in tJavaRow: row1.married = true

[statistics] disconnected

===============================================

>Custom

Component

===============================================

Starting job objRecord at 16:45 27/01/2021.

[statistics] connecting to socket on port 3869

[statistics] connected

com.dhc.wuxd.talend.demo.demo3.source.ObjectInputRecord@51650883

{"age":35.0,"married":true,"name":"ObjectInputRecord"}

obj --> null

name --> ObjectInputRecord

age --> 35

getMarried --> true

[statistics] disconnected

​

Job objRecord ended at 16:45 27/01/2021. [Exit code = 0]

===============================================

I can read name \\ age \\ married, but I can't read ObjConfiguration obj.

​

Does anyone know how to achieve?Thank you.

Labels (5)
1 Reply
undx
Creator
Creator

Hi @han zhen​ ,

This is a bug that has been fixed and will be available on release 1.30.0.

best regards