mysql建立用户画像_SparkSQL构建用户画像

--用户画像宽表模型

create database if not exists adm;

create table if not exists adm.itcast_adm_personas(

user_id string     ,--用户ID

user_name string     ,--用户登陆名

user_sex  string     ,--用户性别

user_birthday string     ,--用户生日

user_age  bigint     ,--用户年龄

constellation string     ,--用户星座

province string     ,--省份

city string     ,--城市

city_level string     ,--城市等级

hex_mail string ,--邮箱

op_mail string ,--邮箱运营商

hex_phone string ,--手机号

fore_phone string ,--手机前3位

op_phone string ,--手机运营商

add_time timestamp ,--注册时间

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_money double        ,--收入

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        ,--更换手机频率

majia_flag string        ,--马甲标志

majie_account_cnt bigint               ,--马甲账号数量

loyal_model bigint ,--用户忠诚度

shopping_type_model bigint        ,--用户购物类型

figure_model bigint ,--身材

stature_model bigint        ,--身高

first_order_time timestamp, --第一次消费时间

last_order_time timestamp, --最近一次消费时间

first_order_ago bigint, --首单距今时间

last_order_ago bigint, --尾单距今时间

month1_hg_order_cnt bigint, --近30天购买次数(不含退拒)

month1_hg_order_amt double, --近30天购买金额(不含退拒)

month2_hg_order_cnt bigint, --近60天购买次数(不含退拒)

month2_hg_order_amt double, --近60天购买金额(不含退拒)

month3_hg_order_cnt bigint, --近90天购买次数(不含退拒)

month3_hg_order_amt double, --近90天购买金额(不含退拒)

month1_order_cnt bigint,        --近30天购买次数(含退拒)

month1_order_amt double, --近30天购买金额(含退拒)

month2_order_cnt bigint,        --近60天购买次数(含退拒)

month2_order_amt double, --近60天购买金额(含退拒)

month3_order_cnt bigint,        --近90天购买次数(含退拒)

month3_order_amt double, --近90天购买金额(含退拒)

max_order_amt double, --最大消费金额

min_order_amt double, --最小消费金额

total_order_cnt bigint, --累计消费次数(不含退拒)

total_order_amt double, --累计消费金额(不含退拒)

user_avg_amt double, --客单价(含退拒)

month3_user_avg_amt double, --近90天的客单价

common_address string, --常用收货地址

common_paytype string, --常用支付方式

month1_cart_cnt bigint, --近30天购物车的次数

month1_cart_goods_cnt bigint,        --近30天购物车商品件数

month1_cart_submit_cnt bigint,        --近30天购物车提交商品件数

month1_cart_rate double,        --近30天购物车成功率

month1_cart_cancle_cnt double,        --近30天购物车放弃件数

return_cnt bigint, --退货商品数量

return_amt double, --退货商品金额

reject_cnt bigint, --拒收商品数量

reject_amt double, --拒收商品金额

last_return_time timestamp, --最近一次退货时间

school_order_cnt bigint,        --学校下单总数

company_order_cnt bigint, --单位下单总数

home_order_cnt bigint, --家里下单总数

forenoon_order_cnt bigint, --上午下单总数

afternoon_order_cnt bigint, --下午下单总数

night_order_cnt bigint, --晚上下单总数

morning_order_cnt bigint, --凌晨下单总数

first_category_id BIGINT,             --一级分类ID

first_category_name STRING,          --一级分类名称

second_category_id BIGINT,           --二分类ID

second_catery_name STRING,         --二级分类名称

third_category_id BIGINT,            --三级分类ID

third_category_name STRING,        --三级分类名称

month1_category_cnt BIGINT,        --近30天购物类目次数

month1_category_amt STRING,       --近30天购物类目金额

month3_category_cnt BIGINT,        --近90天购物类目次数

month3_category_amt STRING,      --近90天购物类目金额

month6_category_cnt BIGINT,       --近180天购物类目次数

month6_category_amt STRING,      --近180天购物类目金额

total_category_cnt BIGINT,         --累计购物类目次数

total_category_amt STRING,        --累计购物类目次数

month1_cart_category_cnt BIGINT,   --近30天购物车类目次数

month3_cart_category_cnt BIGINT,   --近90天购物车类目次数

month6_cart_category_cnt BIGINT,    --近180天购物车类目次数

total_cart_category_cnt BIGINT,      --累计购物车类目次数

last_category_time

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值