Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

change datatype of external table

change datatype of external table

Expert Contributor

I had a external table that contains some string columns, now I need to change the datatype of some columns, so I used :

ALTER TABLE table CHANGE col col type;

but this query gives me a error:

org.apache.spark.sql.AnalysisException: ALTER TABLE CHANGE COLUMN is not supported for changing column 'id' with type 'StringType' to 'id' with type 'LongType';

any suggestion would be greatly welcome, thanks


Re: change datatype of external table

Super Guru

Specify type as BigInt which is Equivalent to long type,hive don't have long datatype.

for more reference

Don't have an account?
Coming from Hortonworks? Activate your account here