Writing data from Hadoop to Vertica

Moderator: NorbertKrupa

Post Reply
vinodh.kumaresan
Newbie
Newbie
Posts: 1
Joined: Wed Aug 07, 2013 2:49 pm

Writing data from Hadoop to Vertica

Post by vinodh.kumaresan » Wed Aug 07, 2013 3:04 pm

Hi,

I am writing data from Hadoop to Vertica.
Vertica Table Structure is like this
Table Name : STUDENT_TB
Schema | Table | Column | Type | Size | Default | Not Null | Primary Key | Foreign Key
--------+------------+------------------+--------------+------+-------------+----------+-------------+-------------
SAMPLE | STUDENT_TB | STUD_ID | int | 8 | | t | t |
SAMPLE | STUDENT_TB | INSERT_DATE | date | 8 | "sysdate"() | t | f |
SAMPLE | STUDENT_TB | DELETE_DATE | date | 8 | | f | f |
SAMPLE | STUDENT_TB | STUD_NAME | varchar(30) | 30 | | t | f |

Hadoop connector would load only the STUD_ID AND STUD_NAME
i have the VerticaOutputFormat and VerticaRecord as shown below.
VerticaOutputFormat.setOutput(job, "DB.SAMPLE.STUDENT_TB", true, "STUD_ID int", "STUD_NAMErecord.set(0, 1);

record.set(0, 1);
record.set(1, "JACKSON");

When i execute the code, it gives me the following error
java.io.IOException: java.sql.BatchUpdateException: [Vertica][VJDBC](100172) One or more rows were rejected by the server.
at com.vertica.hadoop.VerticaRecordWriter.close(VerticaRecordWriter.java:90)
But when i mention all the column of the table in the VerticaOutputFormat and VerticaRecord, it works fine. I would require vertica to insert sysdate in the INSERT_DATE column and DELETE_DATE should be empty.

Would you please provide me a solution to proceed further.Do let me know if additional information is required.

Thanks,
Vinodh

Post Reply

Return to “Hadoop Connector”