--用户画像--客户属性信息表
drop table if exists gdm.gdm_user_portrait_basic;
CREATE EXTERNAL TABLE gdm.gdm_user_portrait_basic(
user_id bigint ,--用户ID
user_name string ,--用户登录名
user_sex string ,--性别
user_birthday string ,--生日
user_age bigint ,--年龄
constellation string ,--星座
big_area_name string ,--大区域
province string ,--省份
city string ,--城市
city_level string ,--城市等级
hex_mail string ,--邮箱
op_mail string ,--邮箱运营商
hex_phone string ,--加密手机
fore_phone string ,--手机前几位
op_phone string ,--手机运营商
add_time string ,--注册时间
login_ip string ,--登陆IP地址
login_source string ,--登录来源
request_user string ,--邀请人
total_mark bigint ,--会员积分
used_mark bigint ,--已使用积分
level_name string ,--会员等级名称
blacklist bigint ,--用户黑名单
is_married bigint ,--婚姻状况
education string ,--学历
monthly_income bigint ,--月收入
profession string ,--职业
sex_model bigint ,--性别模型
is_pregnant_woman bigint ,--是否孕妇
is_have_children bigint ,-- 是否有小孩
children_sex_rate double ,--孩子性别概率
children_age_rate double ,--孩子年龄概率
is_have_car bigint ,--是否有车
potential_car_user_rate double ,--潜在汽车用户概率
phone_brand string ,--使用手机品牌
phone_brand_level string ,--使用手机品牌档次
phone_cnt bigint ,--使用多少种不同的手机
change_phone_rate bigint ,--更换手机频率(月份)
majie_flag string ,--马甲标志
majie_account_cnt bigint ,--马甲账号数量
loyal_model bigint ,--用户忠诚度
shopping_type_model bigint ,--用户购物类型
figure_model bigint ,--身材
stature_model bigint ,--身高
dw_date timestamp
)
partitioned by
(dt string)
;
#***************************************************************
#文件名称: gdm_user_portrait_basic.sql
#
#****************************************************************
insert overwrite table gdm.gdm_user_portrait_basic partition(dt = '2015-01-01')
select
t.user_id bigint ,--用户ID
t.user_name string ,--用户登录名
t.user_sex string ,--性别
t.user_birthday string ,--生日
t.user_age bigint ,--年龄
t.constellation string ,--星座
t.big_area_name string ,--大区域
t.province string ,--省份
t.city tring ,--城市
t.city_level string ,--城市等级
t.hex_mail string ,--邮箱
t.op_mail string ,--邮箱运营商
t.hex_phone string ,--加密手机
t.fore_phone string ,--手机前几位
t.op_phone string ,--手机运营商
t.add_time string ,--注册时间
t.login_ip string ,--登陆IP地址
t.login_source string ,--登录来源
t.request_user string ,--邀请人
t.total_mark bigint ,--会员积分
t.used_mark bigint ,--已使用积分
t.level_name string ,--会员等级名称
t.blacklist bigint ,--用户黑名单
t.is_married bigint ,--婚姻状况
t.education string ,--学历
t.monthly_income bigint ,--月收入
t.profession string ,--职业
null sex_model bigint ,--性别模型
null is_pregnant_woman bigint ,--是否孕妇
null is_have_children bigint ,-- 是否有小孩
null children_sex_rate double ,--孩子性别概率
null children_age_rate double ,--孩子年龄概率
null is_have_car bigint ,--是否有车
null potential_car_user_rate double ,--潜在汽车用户概率
null phone_brand string ,--使用手机品牌
null phone_brand_level string ,--使用手机品牌档次
null phone_cnt bigint ,--使用多少种不同的手机
null change_phone_rate bigint ,--更换手机频率(月份)
null majie_flag string ,--马甲标志
null majie_account_cnt bigint ,--马甲账号数量
null loyal_model bigint ,--用户忠诚度
null shopping_type_model bigint ,--用户购物类型
null figure_model bigint ,--身材
null stature_model bigint ,--身高
from_unixtime(unix_timestamp()) dw_date
from (select * from fdm.fdm_user_wide where dt ='2015-01-01') t
;