首页 > 其他 > 详细

[Hive_7] Hive 中的 DDL 操作

时间:2019-01-05 19:40:00      阅读:142      评论:0      收藏:0      [点我收藏+]

0. 说明

 

  DDL(Data Definition Languages)语句:数据定义语言
  这些语句定义了不同的数据段、数据库、表、列、索引等数据库对象的定义。
  常用的语句关键字主要包括 create、drop、alter 等。

 


 

1. alter

# 1.修改表名
    alter table wc rename to wc3;    

# 2.添加列
    alter table customers add columns(wife string);

# 3.删除列,不能用
    alter table customers drop column wife;

# 4.替换所有列,修改字段名
    alter table customers replace columns(id int, name string, age int);

# 5.将id列改名为no,类型为string
     alter table customers change column id no string;

 

 

 

 


 

[Hive_7] Hive 中的 DDL 操作

原文:https://www.cnblogs.com/share23/p/10225513.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!