Advanced Analytics Forum

How to change datatype of a column in hive  

  RSS

Jitesh Reddy
(@hadoopuser)
New Member
Joined: 4 months ago
Posts: 4
03/10/2018 1:05 pm  

Hi,

Incidentally, I used an incorrect datatype while creating the table in Hive. Now I want to change the datatype without dropping the table.

Can you please tell me how to change the datatype of a column in the hive?


ReplyQuote
Topic Tags
HDFS Tutorial Team
(@ashuhadoop)
Member Admin
Joined: 3 years ago
Posts: 3
03/10/2018 1:14 pm  

Yes, you can change the datatype of an existing column without dropping it.

Here is the query-

ALTER TABLE table_name CHANGE col_name col_name newType

ReplyQuote
Share:

  
Working

Please Login or Register