Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 🙂
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.