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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
christ_eprimo
Contributor
Contributor

check if nullable in schema in tjavaFlex

Dear helpers

 

I'm trying to check if a field is nullable i.e. if a column can have NULL values.

Although the schema includes the boolean field "nullable", the following code snippet does not return if a field is nullable:

Field[] fields = row1.getClass().getDeclaredFields();

 

Is there any way to retrieve the information if a column according to the schema is nullable?

 

Best regards and many thanks in advance

Labels (2)
2 Replies
Anonymous
Not applicable

Hi,

 

    If it is a simple check, you can do it in tMap itself like below

 

Relational.ISNULL(row1.field)?"true part":"false part"

   If you want to check the details with a schema, you can use the tSchemaComplianceCheck component. Could you please share more idea about your use case with some sample data so that we can understand why a tJavaFlex is needed?

 

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 🙂

TRF
Champion II
Champion II

The generated code with or without the nullable checkbox ticked are absolutly the same.

Well, at least with a minimal job with a tFixedInputFlowInput and a tJavaRow component.

Not sure what you're asking is possible.

Maybe this link may helps https://community.talend.com/t5/Archive/Function-of-nullable-field/td-p/188312

 

@nthampi the question is about nullable fileds detection, not null value detection during row processing.