Nullpointer exception on tWriteJSONField

Eight Stars

Nullpointer exception on tWriteJSONField

Hi, 

Can I please get some fresh eyes debugging on this? I simply want to output a JSON when the tSchemaComplianceCheck rejects input (here when col_1 is null). The tWriteJsonField keeps shouting a NullpointerException like this:

 

Exception in component tWriteJSONField_1_Out (draft)
java.lang.NullPointerException
	at awodoodi.draft_0_1.draft.tFixedFlowInput_1Process(draft.java:3223)
	at awodoodi.draft_0_1.draft.runJobInTOS(draft.java:8179)
	at awodoodi.draft_0_1.draft.main(draft.java:6256)

Screenshot from 2019-01-11 11-51-58.png

Screenshot from 2019-01-11 11-57-02.pngScreenshot from 2019-01-11 11-53-47.png

Tags (1)

Accepted Solutions
Eight Stars

Re: Nullpointer exception on tWriteJSONField

I see. Really strange, though. Why would a component raise an exception even if its own schema is correct? As shown in the screenshot below, the tWriteJSONField has only a single nullable column. 

 

Screenshot from 2019-01-11 15-36-35.pngAnyway, thanks for your answer @vapukov. I think I will replace this tSchemaComplianceCheck with a good old tJava where I can make advanced data validation, and keep the tMap for two output flows (valid/invalid)

 


All Replies
Forteen Stars

Re: Nullpointer exception on tWriteJSONField

it interesting issue

from tSchemaComplianceCheck your output schema contains one not null column - it is exactly column which is null and rejected

 

and this NULL value - give error for tWriteJSON, because it expect not null value in this column (not important do you use it or not)

 

you can install tMap between and in tMap make it nullable

Screen Shot 2019-01-12 at 1.26.55 AM.png

 

Screen Shot 2019-01-12 at 1.26.47 AM.png

 

-----------
Eight Stars

Re: Nullpointer exception on tWriteJSONField

I see. Really strange, though. Why would a component raise an exception even if its own schema is correct? As shown in the screenshot below, the tWriteJSONField has only a single nullable column. 

 

Screenshot from 2019-01-11 15-36-35.pngAnyway, thanks for your answer @vapukov. I think I will replace this tSchemaComplianceCheck with a good old tJava where I can make advanced data validation, and keep the tMap for two output flows (valid/invalid)

 

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

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch