Five Stars

error when testing an expression

Exception in thread "main" java.lang.Error: Unresolved compilation problems:  

comes up in red

 

image attached

 

does anyone think the expression is incorrect? -- no, so why the error?

 

upon exiting expression builder and run the job it works perfectly... known bug?

 

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Ten Stars

Re: error when testing an expression

I was able to reproduce this when I put "Y" as the value for name2.  I finally found an example of how to use the expression builder Test feature in the documentation:

https://help.talend.com/reader/nXPtKhielAtSqFD6_f7~OQ/UiJEcAn2BxH5csEtuIR5pA

 

It shows that test values should not be wrapped in quotes, so I removed my quotes.  After that, the test started working and displays "Yes" in the output area.

14 REPLIES
Nine Stars TRF
Nine Stars

Re: error when testing an expression

 This should be better:

"Y".equalsIgnoreCase(row2.name2) ? "Yes" : "No"

TRF
Five Stars

Re: error when testing an expression

Thanks but gives same error when hitting the  test button !

see image

Ten Stars

Re: error when testing an expression

Should the test value be "Y" instead of just Y?

Moderator

Re: error when testing an expression

Hello,

Don't use =="".  Instead use .equals("").

Is your tMap Ok with you when you omit clicking on "Test"?

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.
Five Stars

Re: error when testing an expression

Thanks all but still gives an error.....

 

how do I check if this is a bug in Talend ?

 

the code works, however the code that runs behind the Test! button does not seem to like expressions with correct syntax !

 

Moderator

Re: error when testing an expression

Hi,

 Have you tried to execute your job without clicking on "Test" to see if there is any error printed on console?

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.
Five Stars

Re: error when testing an expression

Bury your head in the sand and IGNORE THE FACT THAT TALEND HAS AN BUG................ at your peril,

 

if this tool does not work as expected i'm not committing my companies data to it , period. THERE IS NO TRUST, reasonable ? tell me if i'm not being reasonable?

 

hand coded java c# f# will always be better,  than a tool that is always half right because you will never know when Talend is telling the truth and when it has odd error messages for no reason!

 

 

Ten Stars

Re: error when testing an expression

Did you attempt to change the test value to "Y" like I suggested?  Fields which take string literals in Talend almost always require that the value be wrapped in quotes.  I did not see quotes around the Y in your original screenshot.

Five Stars

Re: error when testing an expression

Thanks  cterenzi

 

I did, got same error from the Test ! button.

I think its just a bug, but false positives are very very dangerous.

 

 

Tags (1)
Ten Stars

Re: error when testing an expression

I was able to reproduce this when I put "Y" as the value for name2.  I finally found an example of how to use the expression builder Test feature in the documentation:

https://help.talend.com/reader/nXPtKhielAtSqFD6_f7~OQ/UiJEcAn2BxH5csEtuIR5pA

 

It shows that test values should not be wrapped in quotes, so I removed my quotes.  After that, the test started working and displays "Yes" in the output area.

Moderator

Re: error when testing an expression

Hi,

We usually use the Test! button to test a function.

The Test! button can't understand "Y" for your column value name2, you need to execute the job to see if the job works without any compilation error or Java error to locate your issue in expression.

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.
Five Stars

Re: error when testing an expression

Great 

 

re: We usually use the Test! button to test a function.

 

can you point me to the documentation for the Test! button

 

 

Five Stars

Re: error when testing an expression

Thank you again cterenzi (Kudos to you for the post !!)

 

Great reply and good link to documentation (love the chuck Norris ref !)

 

I have found the issue and it IS A BUG in the Talend expression/function checker, the coder who wrote this did not check for a Var (variable) that has no name defined

I wonder if they also checked for variables that are reserved words?

 

see screen shot of blank variable !

 

Moderator

Re: error when testing an expression

Hello,

Here is online document about:TalendHelpCenter:tMap operation

Feel free to create a jira issue about your issue or concern on talend bug tracker.https://jira.talendforge.org/secure/Dashboard.jspa

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.