大数据竞赛数据抽取部分_gy_pub,费时6个月成功入职阿里

66 阅读2分钟

source ~/ds_pub.sql和gy_pub.sql文件,先上传至服务器家目录下。

链接:pan.baidu.com/s/1FmbqH86k… 
提取码:egeu 
--来自百度网盘超级会员V5的分享

Hive数据准备

create database ods;
use ods;

create table if not exists ods.user_info(
  id bigint,
  login_name string,
  nick_name string,
  password string,
  name string,
  phone_num string,
  email string,
  head_img string,
  user_level string,
  birthday date,
  gender string,
  create_time timestamp,
  operate_time timestamp)
partitioned by(etldate string) row format delimited fields terminated by '\001' stored as textfile;

insert into table ods.user_info partition (etldate="19971201") values(6814,"89xtog","周杰伦","","卖片",17777124243,"89xtong@163.net","",1,"1965-04-26","M","2020-04-26 18:55:55","2020-04-26 5:53:55");



CREATE TABLE `ods.sku_info`  (
  `id` bigint,
  `spu_id` bigint,
  `price` decimal(10, 0),
  `sku_name` string,
  `sku_desc` string,
  `weight` decimal(10, 2),
  `tm_id` bigint,
  `category3_id` bigint,
  `sku_default_img` string,
  `create_time` timestamp
)partitioned by(etldate string)
row format delimited fields terminated by '\001' stored as textfile;

insert into ods.sku_info partition(etldate="19971201") values(1,1,2220,"测试","new ssku_desc",0.24,2,61,"http://www.baidu.com","1997-12-01 12:21:13");



CREATE TABLE `ods.base_province`  (
  `id` bigint,
  `name` string,
  `region_id` string,
  `area_code` string,
  `iso_code` string
)partitioned by(etldate string) row format delimited fields terminated by '\001' stored as textfile;

insert into table ods.base_province partition (etldate="19971201") values(0,"测试",1,110000,"CN-11");
alter table ods.base_province add columns ('create_time' timestamp);





CREATE TABLE `ods.base_region`  (
  `id` string,
  `region_name` string
)partitioned by(etldate string) row format delimited fields terminated by '\001' stored as textfile;


insert into table ods.base_region partition (etldate="19971201") values (0,"测试");
alter table ods.base region add columns ('create time' timestamp);





CREATE TABLE `ods.order_detail` (
  `id` bigint,
  `order_id` bigint,
  `sku_id` bigint,
  `sku_name` string,
  `img_url` string,
  `order_price` decimal(10, 2),
  `sku_num` string,
  `create_time` timestamp,
  `source_type` string, 
  `source_id` bigint
) partitioned by(etldate string) row format delimited fields terminated by '\001' stored as textfile;

insert into table ods.order_detail partition(etldate="19971201") values(8621,3443,4,"测试","http://www.baidu.com",1442.00,1,"1997-12-01 18:47:14",2401,""); 




CREATE TABLE `ods.order_info` (


![img](https://p6-xtjj-sign.byteimg.com/tos-cn-i-73owjymdk6/d4efd0b6200c40cd94a3fd9ecca516eb~tplv-73owjymdk6-jj-mark-v1:0:0:0:0:5o6Y6YeR5oqA5pyv56S-5Yy6IEAg5py65Zmo5a2m5Lmg5LmL5b-DQUk=:q75.awebp?rk3s=f64ab15b&x-expires=1772462187&x-signature=X3Rm0L8MIZJFidG0FR0K4y1QFv0%3D)
![img](https://p6-xtjj-sign.byteimg.com/tos-cn-i-73owjymdk6/12ae228774654b6e8ca23011122cde5d~tplv-73owjymdk6-jj-mark-v1:0:0:0:0:5o6Y6YeR5oqA5pyv56S-5Yy6IEAg5py65Zmo5a2m5Lmg5LmL5b-DQUk=:q75.awebp?rk3s=f64ab15b&x-expires=1772462187&x-signature=ukGmYw2sKB3nZoVnmG0TZPxhKtI%3D)

**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**[需要这份系统化资料的朋友,可以戳这里获取](https://gitee.com/vip204888)**


**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**