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’;