Hive管理表

hive建表初体验
use myhive;
create table stu(id int,name string);
insert into stu values (1,“zhangsan”);
select * from stu;

Hive管理表Hive管理表Hive管理表
创建表并指定字段之间的分隔符

create table if not exists stu2(id int ,name string) row format delimited fields terminated by ‘\t’ stored as textfile location ‘/user/stu2’;
Hive管理表
根据查询结果创建表

create table stu3 as select * from stu2;
Hive管理表
根据已经存在的表创建表
create table stu4 like stu2;
Hive管理表
查询表的类型
desc formatted stu2;
Hive管理表