Hive数据仓库——DDL、DQL概述
Hive–HQL语法–DDL
- 创建数据库 create database XXXXX;
- 查看数据库 show databases;
- 删除数据库 drop database tmp;
- 强制删除数据库:drop database tmp cascade;
- 查看表:SHOW TABLES;
- 查看表的元信息:
- desc test_table;
- describe extended test_table;
- describe formatted test_table;
- 查看建表语句:show create table table_XXX;
- 重命名表:alter table test_table rename to new_table;
- 修改列数据类型:alter table lv_test change column colxx string;
- 增加、删除分区:
- alter table test_table add partition (pt=xxxx);
- alter table test_table drop if exists partition(…);