修改/更改命令在HIVE中不起作用,无法将字符串类型数据转换为TIMESTAMP

时间:2019-02-04 08:01:04

标签: sql hadoop hive

我想在配置单元中将数据类型从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的最佳方法是什么。

0 个答案:

没有答案