Hive的HQL语法

Hive的HQL语法,第1张

Hive的HQL语法

1:创建数据库 create database xxxxx;

2:查看数据库 show databases;

3:删除数据库 drop database tmp;

4:强制删除数据库:drop database tmp cascade;

5:查看表:SHOW TABLES;

6:查看表的元信息:

desc test_table;

describe extended test_table;

describe formatted test_table;

7:查看建表语句:show create table table_XXX

8:重命名表:

alter table test_table rename to new_table;

9:修改列数据类型:alter table lv_test change column colxx string;

10:增加、删除分区:

alter table test_table add partition (pt=xxxx)

alter table test_table drop if exists partition(...);

 注意:HQL的其他的语法基本与mysql中一样

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5696457.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存