bigdata - Alter column data type in Hive -


we need alter table column data type string date. while trying getting below error. please help.

hive> describe sales_staging;

ok

cust_id string prod_num string
qty int sale_date string

sale_id string time taken: 0.151 seconds, fetched: 5 row(s)

hive> alter table sales_staging change sale_date sale_date date ;

failed: execution error, return code 1 org.apache.hadoop.hive.ql.exec.ddltask. unable alter table. following columns have types incompatible existing columns in respective positions :sale_date

hive>

you can't give same name column wish change datatype of. use this

alter table sales_staging change sale_date sale_date_new date; 

refer apache hive wiki


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -