(1)创建数据库:create database zy_test;
(2)显示所有数据库:show databases;
(3)使用某数据库:use sgs_test;
(4)显示所有表:show tables;
(5)创建表:create table zy_test(name string);
(6)描述表:desc sgs_test.zy_test;
(7)本地导入hive:load data local inpath '/home/sgs_test/test.txt' overwrite into table sgs_test.zy_test;
(8)查询表:select * from sgs_test.zy_test;
(9)hive导出到本地:insert overwrite local directory '/home/sgs_test/' select * from sgs_test.zy_test;
(10)删除表:drop table zy_test;
(11)create table zy_test(name string);
(12)hdfs导入hive:load data inpath '/tmp/test.txt' overwrite into table sgs_test.zy_test;
(13)hive导出至hdfs:insert overwrite directory '/tmp/zy/' select * from sgs_test.zy_test;
(14)创建外部表:create external table sgs_test.zy_test_ext(name string) row format delimited fields terminated by ',' stored as orc;
Hive常用shell命令
Hive SQL操作指南
最新推荐文章于 2024-07-08 10:04:41 发布
本文详细介绍了使用Hive SQL进行数据库及表的基本操作,包括创建、显示、导入、查询、导出、删除等核心功能,并提供了具体语法示例。
1068

被折叠的 条评论
为什么被折叠?



