我想在配置单元中将数据类型从String
更改为TimeStamp
,但是下面的查询无济于事。
ALTER TABLE so_wireless_cpu_utilization MODIFY start_time start_time TIMESTAMP;
它抛出以下错误:
Getting log thread is interrupted, since query is done!
Error: Error while compiling statement: FAILED: ParseException line 1:40 cannot recognize input near 'MODIFY' 'start_time' 'start_time' in alter table statement (state=42000,code=40000)
org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:40 cannot recognize input near 'MODIFY' 'start_time' 'start_time' in alter table statement
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:279)
此外,我尝试了以下查询,但它也不起作用:
alter table so_wireless_ap_channels CHANGE load_date load_date String;
那么在string
中将timestamp
格式转换为hive
的最佳方法是什么。