大数据全系列 教程
1869个小节阅读:467.2k
目录
408考研
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
数据文件:软件\data_format.zip。
首先将 "软件\data_format.zip"解压
文件user_info_format1.csv存放的是用户的信息,文件中的字段:
user_id age_range gender
376517 6 1
用户表建表脚本:
xxxxxxxxxx
create table user_info(
id int comment "唯一表示id",
age_range int comment "年龄范围",
gender int comment "性别 0女 1男 2保密"
)
row format delimited
fields terminated by ","
lines terminated by "\n";
文件user_log_format1.csv存放的是购买日志,文件中的字段:
xxxxxxxxxx
user_id,item_id,cat_id,seller_id,brand_id,time_stamp,action_type
用户购买日志表:
xxxxxxxxxx
create table user_log(
user_id int comment "买家id",
item_id int comment "产品id",
cat_id int comment "分类id",
seller_id int comment "卖家id",
brand_id int comment "品牌id",
time_stamp bigint comment "时间戳",
action_type int
)
row format delimited
fields terminated by ","
lines terminated by "\n";
xxxxxxxxxx
[root@node3 ~]# hive --hiveconf hive.cli.print.header=true