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

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