Multiplying values compilation error

One Star

Multiplying values compilation error

Hi all,
I am trying to convert a csv file to xml.  I have a csv and an xml created using an existing format in my meta data.
I have an input file, a tmap, and an output file.
In the tmap, i'm trying to map a decimal column to an integer column, while multiplying the value by 100 in the process.
I googled a few methods, and the one below seemed to be used by others.

row1.Price.Multiply(BigDecimal.valueOf(100))

However, Multiply gets underlined, and an exception of Unresolved compilation problem is generated.
I read somewhere else about looking for the error in the code, but I can't even find "multiply" in the code, so i'm assuming i've not installed something correctly, but it might just be that i'm using the wrong statement in the first place.
Any pointers in the right direction would be much appreciated.

Kind regards
Phil

Moderator

Re: Multiplying values compilation error

Hi Phil,

Have you tried to switched  tab from "Designer" to " Code" to see unresolved compilationin java code?

Do you check component TalendHelpCenter:tWriteXMLFields which embeds the incoming data into a single XML column.

Best regards
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.
One Star

Re: Multiplying values compilation error

Hi Sabrina,

How do I do that?
I have a repository tab on the left, with Business Models, Job Designs (with my job in it), Contexts, Code etc. 
In the Code section is Routines and Pig UDF.
In the Routines section is System, and under that; DataOperation, Mathematical, Numberic, Relational, StringHandling, TalendDataGenerator, TalendDate and TalendString.

Kind regards,
Phil
Moderator

Re: Multiplying values compilation error

Hi Phil,

Next to the Designer tab there is a Code tab that lets you view the source code for the entire Job.


Best regards
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.
One Star

Re: Multiplying values compilation error

Thanks Sabrina,

Is it correct that I shouldn't actually see any code?  However, I can see the warnings and errors.

Other than the "The method Multiply(BigDecimal) is undefined for the type BigDecimal" in the screenshot, the warnings include (in order, and the first 2 warning markers in the screenshot are for the same warning);
Comparable is a raw type. References to generic type Comparable <T> should be parameterized.
Type safety: The method compareTo(Object) belongs to the raw type Comparable.
Type safety: Unchecked cast from List to List
Type safety: The method add(int, Object) belongs to the raw type list.
The method getRowNumber() from the type FileInputDelimited is deprecated.
The static method convertToJsonText(Object, List<string>) from the type ResumeUtil should be accessed in a static way.

However, I might have found the reason why i'm getting these errors, but I don't know how to resolve it:
On opening Talend, the Additional Talend Packages installer starts and show available features to install:
1 optional and 338 required.  Version 6.0.1.20150908_1633.

However, they fail to install;
java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
Any pointers in the right direction would be much appreciated.

Kind regards,
Phil
Moderator

Re: Multiplying values compilation error

Hi,
Is it correct that I shouldn't actually see any code?  However, I can see the warnings and errors.

Have you tried to restart your studio to see if it works?
might have found the reason why i'm getting these errors, but I don't know how to resolve it:
On opening Talend, the Additional Talend Packages installer starts and show available features to install:
1 optional and 338 required.  Version 6.0.1.20150908_1633.

Is your network OK with you? Here is a document about:TalendHelpCenter:Configuring Talend Studio.

Best regards
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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog