create table student(
id string,
name string
) row format delimited fields terminated by ‘\t’;
将本地文件加载到表中
load data local inpath ‘/usr/local/data.txt’ into table student;
将hdfs文件加载到表中
load data inpath ‘/haha.log’ into table student;
hive/bin目录下hiveserver2 开启服务
使用beeline进入
!connect jdbc:hive2://localhost:10000
删除表
drop table users;
清空表数据
truncat table tablename;
创建外部表
create external table exuser(id int, name string)
row format delimited fields terminated by ‘\t’;