Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the FIELD TERMINATED value for an existing Hive table?

Tags:

hadoop

hive

I currently have a table t1 which was set a value of '\t' in my FIELD TERMINATED clause.

Now I would like to change that particular clause in structure of the Table t1.

Is there any way to ALTER the FIELD TERMINATED clause after creation?

like image 294
Kaushik Avatar asked Jan 20 '14 12:01

Kaushik


2 Answers

hive >

ALTER TABLE table_name    
set serde 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES ('field.delim' = '|');

It works. Check DESC FORMATTED tbl_name before and after applying the query. Hope this helps!

like image 169
vijay kumar Avatar answered Oct 27 '22 00:10

vijay kumar


As already stated by Randall , it did not work directly. So solution is below which seems catching .

ALTER TABLE table_name SET SERDEPROPERTIES ('field.delim' = ',');
like image 29
Sumeet Kumar Avatar answered Oct 26 '22 22:10

Sumeet Kumar