hiveQL

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章