Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
One of the columns in my schema is called "public" but Talend doesn't allow me to use it due to it being a reserved word. What's the best way to make it printed as a header in a file if I can't use it in the schema?
Thanks in advance!
This is a bit of a pain but is due to Java reserved words. Take a look here https://www.computerhope.com/jargon/j/java_reserved_words.htm
One way to get around this is to pre-emptively write the header of your file using a tFixedFlowInput component connected to your file in a SubJob. Use it to write the first row as data. Once this is done, in a SubJob following this, write your data to the file with a different file component and set the append option to true. So the first write will add the header, the second will add your data.
Granted, this is not ideal. But it is a niche issue caused by the fact that Java is used to build the jobs.
This is a bit of a pain but is due to Java reserved words. Take a look here https://www.computerhope.com/jargon/j/java_reserved_words.htm
One way to get around this is to pre-emptively write the header of your file using a tFixedFlowInput component connected to your file in a SubJob. Use it to write the first row as data. Once this is done, in a SubJob following this, write your data to the file with a different file component and set the append option to true. So the first write will add the header, the second will add your data.
Granted, this is not ideal. But it is a niche issue caused by the fact that Java is used to build the jobs.