有没有办法改变配置单元表中的列类型? [英] Is there a way to alter column type in hive table?

查看:115
本文介绍了有没有办法改变配置单元表中的列类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前模式是:

The current schema is:

hive> describe tableA;
OK
id      int
ts      timestamp

我想改变 ts 列为 BIGINT ,但不丢弃表并重新创建。是否有可能?

I want to change ts column to be BIGINT without dropping table and recreate again. Is it possible?

推荐答案

找到解决方案:

Found the solution:

ALTER TABLE tableA CHANGE ts ts BIGINT AFTER id;

有关完整的详细信息,请参阅: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterColumn

See this for complete details: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterColumn

这篇关于有没有办法改变配置单元表中的列类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆