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` (


**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**[需要这份系统化资料的朋友,可以戳这里获取](https://gitee.com/vip204888)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**