Import CSV file to Postgres with Talend

One Star

Import CSV file to Postgres with Talend

I tried to import a CSV file in my table on PostgreSQL. I used Tmap to match the fields but when I launched the process I got this error:
Exception in thread "main" java.lang.Error: Compilation problem not solved: Invalid character constant
The error I get is too generic to understand. How can I do to investigate the problem?
Six Stars

Re: Import CSV file to Postgres with Talend

Four Stars

Re: Import CSV file to Postgres with Talend

Can you post your statement expression used in tMap?
Vaibhav
Moderator

Re: Import CSV file to Postgres with Talend

Hi romidipa,
You'll get a Image upload box that allows to upload screen captures and images up to 200KB, when you click on "post reply" (not through the quick post").
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: Import CSV file to Postgres with Talend

I put the pictures which I hope will help to understand the problem
One Star

Re: Import CSV file to Postgres with Talend

I put the pictures which I hope will help to understand the problem..
this is my csv
alleg_id;alleg_categoria;alleg_allegato;alleg_descr_breve;alleg_progetto;alleg_sostituito;alleg_categ_sostituita;alleg_aria;alleg_acqua;alleg_territorio;alleg_ordina
60;B1.10;B1;Progetti di infrastrutture - linee ferroviarie a carattere regionale o locale;linee ferroviarie a carattere regionale o locale;1;B1.10;1;1;1;65
61;B1.11;B1;Progetti di infrastrutture - funicolari o linee simili di tipo particolare;funicolari o linee simili di tipo particolare, esclusivamente o principalmente adibite al trasporto di passeggeri (vedi cat. B3, n. 6);1;B1.11;1;1;1;66
Four Stars

Re: Import CSV file to Postgres with Talend

I think there is a trouble in metadata creation,
your input columns are 9 - as per csv data
and data shows - 11
tMap shows - 10
Please fix this, however, you don't need tMap, as there is no processing involved... You can remove that...
Vaibhav
One Star

Re: Import CSV file to Postgres with Talend

Now there are 11 field in csv, in pg table e in tmap process. I removed the id serial in postgresql table nevertheless i get this error
Exception in component tMap_1
java.lang.NullPointerException
at demos.csv_table_0_1.csv_table.tFileInputDelimited_1Process(csv_table.java:1447)
at demos.csv_table_0_1.csv_table.runJobInTOS(csv_table.java:2070)
at demos.csv_table_0_1.csv_table.main(csv_table.java:1929)
Four Stars

Re: Import CSV file to Postgres with Talend

There could be multiple reasons for Null pointer exception
- may be that tMap is not receiving expected input from the input component
Can you show the tMap configuration?
Vaibhav