Hive管理表
hive建表初体验
use myhive;
create table stu(id int,name string);
insert into stu values (1,“zhangsan”);
select * from stu;
创建表并指定字段之间的分隔符
create table if not exists stu2(id int ,name string) row format delimited fields terminated by ‘\t’ stored as textfile location ‘/user/stu2’;
根据查询结果创建表
create table stu3 as select * from stu2;
根据已经存在的表创建表
create table stu4 like stu2;
查询表的类型
desc formatted stu2;