0

I am trying to create table in hive, but I am getting the following errorFAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde:org.apache.hadoop.hive.serde2.OpenCSVSerde

please help me on the same.

BruceWayne
  • 3,286
  • 4
  • 25
  • 35
user2572432
  • 7
  • 1
  • 6
  • can you provide the command which you have used to create the table? – Kiran Krishna Innamuri Jul 26 '16 at 11:51
  • create EXTERNAL table concomp(datereceivd STRING, product STRING, subproduct STRING, issue STRING, subissue STRING, concomplaINT STRING, companyresponse STRING, company STRING, state STRING, zip INT, tags STRING, consumerconsent STRING, submittedvia STRING, datesenttocomapny STRING, companyresponsetoconsumer STRING, timelyresponse STRING, consumerdisputed STRING, complaintid INT) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES ("separatorChar" = ",", "quoteChar" = "'", "escapeChar" = "\\" ) STORED AS TEXTF; – user2572432 Jul 26 '16 at 12:19
  • as the file is csv file you can directly load using ** row format delimited fileds terminated by ',' ** – Kiran Krishna Innamuri Jul 26 '16 at 12:38
  • I tried, but I am not getting proper output. – user2572432 Jul 26 '16 at 14:11
  • You will be able to create table without error i guess using this command! isn't? – Kiran Krishna Innamuri Jul 26 '16 at 14:14
  • it is taking " also input andit is not giving the required output, its giving some other columns output. so I though to use opencsv, but while using I am getting error, so could you please help out.. – user2572432 Jul 26 '16 at 14:21
  • ya I am able to create and load csv file, but not getting proper output – user2572432 Jul 26 '16 at 15:07
  • Can you re-check again the table schema using the describe table_name command and also check again the csv file like how many number of columns it exactly contains. Tell me what is the problem with that csv file. – Kiran Krishna Innamuri Jul 27 '16 at 07:17
  • csv file contains 18 columns and using describe command also it's showing 18 columns only, suppose if I am retrieving issue column, it is giving the output of mixture of issue,state,company columns, plz help me out – user2572432 Jul 31 '16 at 02:31
  • It seems your file has 18 columns but few rows are not delimited properly so what you can do is you can eliminate the rows which does not contain all the 18 columns with that you will get the exact data fitted into the table. – Kiran Krishna Innamuri Jul 31 '16 at 05:42
  • are there any shortcuts to eliminate the rows which are not delimited properly, as my csv file contains nearly 2 lakh rows,so could you pleae help me out... – user2572432 Jul 31 '16 at 15:52

0 Answers0