创建表格
drop table if exists DoubanComment;
create table DoubanComment(
commentItem string,
userName string,
voteValue string,
subjectId string,
userId string,
voteCount bigint,
commentTime string,
commentText string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t';
加载数据
几种常见的数据导入方式
(1)、从本地文件系统中导入数据到Hive表;
load data local inpath '/opt/zhu/data/doubanBook_Comments.txt' overwrite into table DoubanComment;
(2)、从HDFS上导入数据到Hive表;
load data inpath '/opt/zhu/data/doubanBook_Comments.txt' overwrite into table DoubanComment;