Unable to access hive table in Impala which has partition create on a date column. The data is inserted using dynamic partition column option. Now date datatype is not supported in impala. what i should do to access this table in impala. Is there is any option to create timestamp partition in hive if so what is method?
Asked
Active
Viewed 568 times
1 Answers
0
You can easily change column type. Two methods:
1) use alter table in Hive, change type to STRING, etc:
alter table table_name change column col_name col_name string cascade;
2) Alternatively you can change table type to EXTERNAL, drop and recreate with different column type then recover partitions:
ALTER TABLE table_name SET TBLPROPERTIES('EXTERNAL'='TRUE');
DROP TABLE table_name;
CREATE TABLE ... --change data type as desired
location... --specify the same location;
After you created the table, use this command to create partitions metadata
MSCK [REPAIR] TABLE tablename;
The equivalent command on Amazon Elastic MapReduce (EMR)'s version of Hive is:
ALTER TABLE tablename RECOVER PARTITIONS;
This will add Hive partitions metadata. See manual here: RECOVER PARTITIONS

leftjoin
- 36,950
- 8
- 57
- 116