hive表的DDL操作
来源:互联网 发布:知巳手机 编辑:程序博客网 时间:2024/05/17 03:40
查看表
hive> show tables;
创建表
hive> create table t1(id int);
查看表结构
hive> desc [extended] t1;
extended是可选的,是扩展的表的信息
删除表
hive> drop table t1;
重命名表的名称
hive> alter table t1 rename to t1_ddl;
修改表中的某一列
hive> alter table t1_ddl change id t_id int;
增加列
mysql:alter table add column colname coltype;
hive> alter table add columns (colname coltype...);可以增加多列
hive> alter table t1_ddl add columns(name string comment 'name', age int);
替换整个表列
hive> alter table t1_ddl replace columns(name string comment 'name', age int);
移动某一列的位置
将某一列放在最前面
hive> alter table t1_ddl add columns(id int);(增加原有的数据)
hive> alter table t1_ddl change id id int first;
将某一列移动到另外一列的后面或前面
hive> alter table t1_ddl change age age int after id;(将age放在id的后面或name的前面)
但是没有提供before和last的实现
0 0
- hive表的DDL操作
- hive常见的DDL操作
- Hive的DDL和DML操作
- Hive基本操作-DDL
- Hadoop Hive基础SQL语法(DDL 操作)
- hadoop学习笔记--11.hive DDL操作
- Hive DDL DML及SQL操作
- HIVE-DDL
- Hive DDL
- Hive ----DDL
- mysql的DDL操作
- Hive表的操作
- Hive表的操作
- DDL语句操作表
- Hive基本操作,DDL操作(创建表,修改表,显示命令),DML操作(Load Insert Select),Hive Join,Hive Shell参数(内置运算符、内置函数)等
- Hive的数据类型、DDL和DML
- Hive DDL & 内部表与外部表
- HIVE入门二之表DDL(一)
- 二叉搜索树与双向链表
- ZOJ 3946 Highway Project(最小费用最短路,优先队列优化dijkstra)
- 转-.NET中GET与SET的用法
- ECharts入门
- LeetCode: Remove Linked List Elements
- hive表的DDL操作
- HTML5第六课时,盒子阴影和outline
- html_js,js的函数,数组,变量
- vue作业
- opengl光照模型
- 矩阵卷积
- 置顶
- HTML5第六课时,float浮动影响的消除,clear
- 使用jquery mobile 创建页面