hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Medwig <jonmed...@gmail.com>
Subject Re: Hive - Alter column datatype
Date Thu, 18 Jul 2013 19:01:19 GMT
Changing the datatype of a column will *not* alter the column's data 
itself - just Hive's metadata for that table. To modify the type of 
existing data:

1. Create a new table with the desired structure
2. Copy the existing table into the new table - applying any necessary 
type casting
3. Drop the old table and rename the new one to the old one's name

See more info here -
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-ChangeColumnName%2FType%2FPosition%2FComment

Jon

On 7/18/13 2:45 AM, Manickam P wrote:
> Hi experts,
>
> I have created a table in hive and loaded the data into it. now i want 
> to change the datatype of one particular column.
> Do i need to drop and move the file again to hive?
> will it work fine if i just alter the data type alone in hive?
>
>
>
> Thanks,
> Manickam P


Mime
View raw message