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

Reply via email to