1.订单表(增量及更新)
drop table if exists ods_order_info;
create external table ods_order_info(
id
string comment ‘订单号’,
final_total_amount
decimal(16,2) comment ‘订单金额’,
order_status
string comment ‘订单状态’,
user_id
string comment ‘用户id’,
out_trade_no
string comment ‘支付流水号’,
create_time
string comment ‘创建时间’,
operate_time
string comment ‘操作时间’,
province_id
string comment ‘省份ID’,
benefit_reduce_amount
decimal(16,2) comment ‘优惠金额’,
original_total_amount
decimal(16,2) comment ‘原价金额’,
feight_fee
decimal(16,2) comment ‘运费’
) comment ‘订单表’
PARTITIONED BY (dt
string) --按照时间创建分区,
row format delimated fields terminated by ‘\t’ --指定分割符为\t
stored as --指定存储方式,读数据采用LzoTextInputFormat;输出数据采用TextOutputFormat
INPUTFORMAT ‘com.hadoop
数据仓库ODS层23张表建模认识
最新推荐文章于 2024-05-01 00:54:49 发布