Null Pointer Exception BigDecimal

Highlighted
Five Stars

Null Pointer Exception BigDecimal

Hey there,

 

I want to use this here:

 

(row5.SUMJHR ! = null ? row5.SUMJHR.toPlainString() : row5.SUMJHR)

 

talend gets me the error: "Type mismatch: cannot convert from Object&Serialzable&Comparable<?> to String"

 

Any Idea? The input row is BigDecimal.

 

Thanks a lot!

 

 


Accepted Solutions
Five Stars

Re: Null Pointer Exception BigDecimal

I got the solution:

 

row5.SUMJHR == null ? null : row5.SUMJHR.toPlainString()


All Replies
Community Manager

Re: Null Pointer Exception BigDecimal

You need to give me more info. For example, what is the field type that this is setting. I am assuming it is String. However, a quick solution might just be this....

 

(row5.SUMJHR ! = null ? row5.SUMJHR.toPlainString() : null)
Eight Stars sgv
Eight Stars

Re: Null Pointer Exception BigDecimal

(row5.SUMJHR ! = null ? row5.SUMJHR.toPlainString() : row5.SUMJHR)

 

i think your expression is wrong. Use this:

(row5.SUMJHR ! = null)? row5.SUMJHR.toPlainString() : row5.SUMJHR

 

Be sure that your output is a String type

 

SGV

 

 

Community Manager

Re: Null Pointer Exception BigDecimal

@sgv there is no difference between those two expressions. The brackets do nothing

Five Stars

Re: Null Pointer Exception BigDecimal

I got the solution:

 

row5.SUMJHR == null ? null : row5.SUMJHR.toPlainString()

Eight Stars sgv
Eight Stars

Re: Null Pointer Exception BigDecimal

I just tested ! You're right =)
Community Manager

Re: Null Pointer Exception BigDecimal

That is what I suggested

Moderator

Re: Null Pointer Exception BigDecimal

Hello,

Please mark solution as accepted if it is OK with you question.

Best regard

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

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