check if nullable in schema in tjavaFlex

Five Stars

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

Employee

Re: check if nullable in schema in tjavaFlex

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 :-)

Fifteen Stars TRF
Fifteen Stars

Re: check if nullable in schema in tjavaFlex

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://www.talendforge.org/forum/viewtopic.php?id=27308

 

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


TRF

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch