One Star

[TOS 5.0.1r74687] Error java generated code for tFileInputDelimited

Hi
I've a problem with tFileInputDelimited component. In my test job I use only this component and tLog.
The file's schema contains 2 strings : MFC and PNR.
All is Built-In (file, schema).
Erreur is : Erreur de syntaxe sur le sème "=", Expression était attendu après ce sème"
And the java generated code is :
			class RowHelper_tFileInputDelimited_2{

public void valueToConn(org.talend.fileprocess.FileInputDelimited fid,row1Struct row1) throws Exception{

String temp = "";

temp = fid.get(0).trim();
if(temp.length() > 0){
row1.PNR = temp;
}else{
row1.PNR = ;
}

temp = fid.get(1).trim();
if(temp.length() > 0){
row1.MFC = temp;
}else{
row1.MFC = ;
}

Any idea ?
Why the generated line is " row1.PNR = ;" ?
Best regards
5 REPLIES
One Star

Re: [TOS 5.0.1r74687] Error java generated code for tFileInputDelimited

Hi,
Could it be that you accidentally set the default value of both fields to a blank space (without any quotes arround it), because that's how I could recreate your issue.
Regards,
Arno
One Star

Re: [TOS 5.0.1r74687] Error java generated code for tFileInputDelimited

Hi
1. Pedro
before my poste, I've tested it in a little separated job. The error appeared each time when I used my generic schema created from an xml file. This xml file is obtained as an export of a schema of a tFileOutputDelimited file generated in an other job.
2. Arno
It was exactly, what you suggested. My schema is generated from xml file.
And there are the blancs value (invisible) in the default value.
As you can see the default value is no blanc but empty string :
  <?xml version="1.0" encoding="UTF-8" ?> 
- <schema>
<column comment="Reference Article" default="" key="false" label="PNR" length="70" nullable="true" originalDbColumnName="PNR" pattern=""dd-MM-yyyy"" precision="-1" talendType="id_String" type="" />
<column comment="Code Entreprise" default="" key="false" label="MFC" length="5" nullable="true" originalDbColumnName="MFC" pattern=""dd-MM-yyyy"" precision="-1" talendType="id_String" type="" />
...

Thanks a lot for your attention.
I have the solution, but I can't explain why, when imported or used as generic schema it produce a blanc in the default property ...
Is it a bug ?
Best regards
P.S.
The "export as xml file" seems work bad : there is the date pattern for a non date fields.
One Star

Re: [TOS 5.0.1r74687] Error java generated code for tFileInputDelimited

Hi,
Yes, I suppose this is a bug, because in your XML there is an empty string, not a blank space...
I tried reproducing this result using my 4.2.3 studio, but couldn't get it to fail. Maybe a 5.0 issue?
Regards,
Arno
One Star

Re: [TOS 5.0.1r74687] Error java generated code for tFileInputDelimited

Hi Arno
Thanks a lot.
You rock!
Regards,
Pedro
One Star

Re: [TOS 5.0.1r74687] Error java generated code for tFileInputDelimited

Smiley Very Happy