------当天付费明细表
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_ffmx;
create table rpt.tmp_mm_rb_daily_ffmx as
select a.* FROM
(select
c.feemsisdn,
c.destmsisdn,
c.day,
c.price/1000 fee,
c.contentid,
dc.content_name,
c.ordernumber,
c.cdrtime,
c.createtime,
c.servcode,p.province_id,p.province as province_name,
case when b.paytype=1 and b.thirdapptype in (14,17) then '应用内计费'
when b.paytype=1 and b.thirdapptype=15 then '网页类计费应用'
ELSE '下载计费' end fftype,row_number()over(distribute by c.ordernumber sort by c.cdrtime) as rnfrom ods.ods_mm_cssp_cdr c LEFT OUTER JOIN dim.dim_mm_phone_city p ON substring(c.feemsisdn,1,7) =p.prefixnumLEFT OUTER JOIN dim.dim_mm_content dc ON c.contentid=dc.content_id
LEFT OUTER JOIN dim.dim_mm_service_content b ON c.servcode=b.servicecodewhere c.day = date_sub('${hiveconf:CURRENT_DATE}', 1)
) a
where a.rn=1;------180天付费明细表
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_180ffmx;
create table rpt.tmp_mm_rb_daily_180ffmx as
select t.day, t.feemsisdn,t.province_id, t.province_name, t.contentid,t.content_name,t.fftype,count(t.ordernumber) ffcs,sum(t.fee) fee
FROM (
select a.* FROM
(selectc.feemsisdn,c.destmsisdn,c.day,c.price/1000 fee,c.contentid,dc.content_name,c.ordernumber,p.province_id,p.province as province_name,case when b.paytype=1 and b.thirdapptype in (14,17) then '应用内计费'
when b.paytype=1 and b.thirdapptype=15 then '网页类计费应用'
ELSE '下载计费' end fftype,row_number()over(distribute by c.ordernumber sort by c.cdrtime) as rnfrom ods.ods_mm_cssp_cdr c LEFT OUTER JOIN dim.dim_mm_phone_city p ON substring(c.feemsisdn,1,7) =p.prefixnumLEFT OUTER JOIN dim.dim_mm_content dc ON c.contentid=dc.content_idLEFT OUTER JOIN dim.dim_mm_service_content b ON c.servcode=b.servicecodewhere c.day >= date_sub('${hiveconf:CURRENT_DATE}', 181)and c.day <= date_sub('${hiveconf:CURRENT_DATE}', 1)
) a where a.rn=1
) tgroup by t.day, t.feemsisdn, t.province_id,t.province_name, t.contentid,t.content_name,t.fftype;------0-6点的订单量/总订单量(time)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb1;
create table rpt.tmp_mm_rb_daily_tb1 as
select a.day,a.province_id,a.province_name,a.contentid,a.content_name,a.fftype,sum(a.fee) amount,var_pop(a.ordernumber) charging_point_concentration,count(a.ordernumber) order_number,count(distinct a.feemsisdn) user_number,sum(a.fee)/count( a.ordernumber) avg_amount,sum(a.fee)/count(distinct a.feemsisdn) amount_per_user,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) in ('00','01','02','03','04','05','06') then a.ordernumber end) /count( a.ordernumber) time,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) = '00' then a.ordernumber end) /count( a.ordernumber) time0,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) = '01' then a.ordernumber end) /count( a.ordernumber) time1,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) = '02' then a.ordernumber end) /count( a.ordernumber) time2,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) = '03' then a.ordernumber end) /count( a.ordernumber) time3,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) = '04' then a.ordernumber end) /count( a.ordernumber) time4,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) = '05' then a.ordernumber end) /count( a.ordernumber) time5,count( case when hour(from_unixtime(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss'),'yyyy-MM-dd HH:mm:ss')) = '06' then a.ordernumber end) /count( a.ordernumber) time6from rpt.tmp_mm_rb_daily_ffmx agroup by a.day,a.province_id,a.province_name,a.contentid,a.content_name,a.fftype;------半年内未付费的当日付费用户数/总付费用户数(new_user_6months1)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb2;
create table rpt.tmp_mm_rb_daily_tb2 as
select t1.day,t1.province_id,t1.province_name,t1.contentid,t1.content_name,t1.fftype,t2.ffyhs /t1.ffyhs new_user_6months1
from (select tt.day,tt.province_id, tt.province_name, tt.contentid,tt.content_name,tt.fftype, count(distinct tt.feemsisdn) ffyhs FROM rpt.tmp_mm_rb_daily_ffmx ttGROUP BY tt.day,tt.province_id, tt.province_name, tt.contentid,tt.content_name,tt.fftype) t1 LEFT OUTER JOIN (select tt.province_id, tt.contentid,tt.content_name, tt.fftype, count(distinct tt.feemsisdn) ffyhsfrom (select a.feemsisdn, b.feemsisdn as bfeemsisdn from rpt.tmp_mm_rb_daily_ffmx a LEFT OUTER JOIN rpt.tmp_mm_rb_daily_180ffmx b ON(a.feemsisdn=b.feemsisdn AND b.day < date_sub('${hiveconf:CURRENT_DATE}', 1))where b.feemsisdn is NULL) t JOIN rpt.tmp_mm_rb_daily_ffmx tt ON t.feemsisdn = tt.feemsisdn GROUP BY tt.province_id,tt.contentid,tt.content_name,tt.fftype
) t2 ON (t1.province_id=t2.province_id and t1.contentid=t2.contentid and t1.fftype=t2.fftype);------半年内未在该APP付费的当日付费用户数/总付费用户数(new_user_6months2)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb3;
create table rpt.tmp_mm_rb_daily_tb3 as
select t1.day,t1.province_id,t1.province_name,t1.contentid,t1.content_name,t1.fftype,t2.ffyhs /t1.ffyhs new_user_6months2
from (select tt.day,tt.province_id, tt.province_name, tt.contentid,tt.content_name,tt.fftype, count(distinct tt.feemsisdn) ffyhs FROM rpt.tmp_mm_rb_daily_ffmx ttGROUP BY tt.day,tt.province_id, tt.province_name, tt.contentid,tt.content_name,tt.fftype) t1 LEFT OUTER JOIN (select tt.province_id, tt.contentid, tt.content_name,tt.fftype,count(distinct tt.feemsisdn) ffyhsfrom (select a.feemsisdn, b.feemsisdn as bfeemsisdn from rpt.tmp_mm_rb_daily_ffmx a LEFT OUTER JOIN rpt.tmp_mm_rb_daily_180ffmx b ON(a.feemsisdn=b.feemsisdn AND a.contentid=b.contentid AND b.day <date_sub('${hiveconf:CURRENT_DATE}', 1))where b.feemsisdn is NULL) t JOIN rpt.tmp_mm_rb_daily_ffmx tt ON t.feemsisdn = tt.feemsisdn GROUP BY tt.province_id,tt.contentid,tt.content_name,tt.fftype
) t2 ON (t1.province_id=t2.province_id and t1.contentid=t2.contentid and t1.fftype=t2.fftype);------三个月内未付费的当日付费用户数/总付费用户数(new_user_3months1)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb4;
create table rpt.tmp_mm_rb_daily_tb4 as
select t1.day,t1.province_id,t1.province_name,t1.contentid,t1.content_name,t1.fftype,t2.ffyhs /t1.ffyhs new_user_3months1
from (select tt.day,tt.province_id, tt.province_name, tt.contentid, tt.content_name,tt.fftype,count(distinct tt.feemsisdn) ffyhs FROM rpt.tmp_mm_rb_daily_ffmx ttGROUP BY tt.day,tt.province_id, tt.province_name, tt.contentid, tt.content_name,tt.fftype) t1 LEFT OUTER JOIN (select tt.province_id, tt.contentid,tt.fftype, count(distinct tt.feemsisdn) ffyhsfrom (select a.feemsisdn, b.feemsisdn as bfeemsisdn from rpt.tmp_mm_rb_daily_ffmx a LEFT OUTER JOIN rpt.tmp_mm_rb_daily_180ffmx b ON(a.feemsisdn=b.feemsisdn AND b.day >= date_sub('${hiveconf:CURRENT_DATE}', 91))where b.feemsisdn is NULL) t JOIN rpt.tmp_mm_rb_daily_ffmx tt ON t.feemsisdn = tt.feemsisdn GROUP BY tt.province_id,tt.contentid, tt.content_name,tt.fftype
) t2 ON (t1.province_id=t2.province_id and t1.contentid=t2.contentid and t1.fftype=t2.fftype);------三个月内未在该APP付费的当日付费用户数/总付费用户数(new_user_3months2)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb5;
create table rpt.tmp_mm_rb_daily_tb5 as
select t1.day,t1.province_id,t1.province_name,t1.contentid,t1.content_name,t1.fftype,t2.ffyhs /t1.ffyhs new_user_3months2
from (select tt.day,tt.province_id, tt.province_name, tt.contentid, tt.content_name,tt.fftype,count(distinct tt.feemsisdn) ffyhs FROM rpt.tmp_mm_rb_daily_ffmx ttGROUP BY tt.day,tt.province_id, tt.province_name, tt.contentid,tt.content_name,tt.fftype) t1 LEFT OUTER JOIN (select tt.province_id, tt.contentid, tt.content_name,tt.fftype,count(distinct tt.feemsisdn) ffyhsfrom (select a.feemsisdn, b.feemsisdn as bfeemsisdn from rpt.tmp_mm_rb_daily_ffmx a LEFT OUTER JOIN rpt.tmp_mm_rb_daily_180ffmx b ON(a.feemsisdn=b.feemsisdn AND a.contentid=b.contentid AND b.day >= date_sub('${hiveconf:CURRENT_DATE}', 91))where b.feemsisdn is NULL) t JOIN rpt.tmp_mm_rb_daily_ffmx tt ON t.feemsisdn = tt.feemsisdn GROUP BY tt.province_id,tt.contentid,tt.content_name,tt.fftype
) t2 ON (t1.province_id=t2.province_id and t1.contentid=t2.contentid and t1.fftype=t2.fftype);------(当日付费次数-昨日付费次数)/昨日付费次数(times_rose_daily) or (当日人均付费金额-昨日人均付费金额)/昨日人均付费金额(amount_per_head_rose_daily)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb6ortb8;
create table rpt.tmp_mm_rb_daily_tb6ortb8 as
select t1.day,t1.province_name,t1.province_id,t1.contentid,t1.content_name,t1.fftype,IF(t2.bffcs is NULL,0,(t1.affcs - t2.bffcs)/t2.bffcs) times_rose_daily,IF(t2.brjfee is NULL,0,(t1.arjfee - t2.brjfee) / t2.brjfee ) amount_per_head_rose_dailyfrom(select a1.day,a1.province_id,a1.province_name,a1.contentid,a1.content_name,a1.fftype,sum(a1.ffcs) affcs,sum(a1.fee) afee,sum(a1.fee) / count(distinct a1.feemsisdn) arjfeefrom rpt.tmp_mm_rb_daily_180ffmx a1where a1.day = date_sub('${hiveconf:CURRENT_DATE}', 1)group by a1.day, a1.province_id,a1.province_name, a1.contentid,a1.content_name,a1.fftype) t1LEFT OUTER JOIN(select a2.day,a2.province_name,a2.province_id,a2.contentid,a2.content_name,a2.fftype,count(distinct a2.feemsisdn) bffyhs,sum(a2.ffcs) bffcs,sum(a2.fee) bfee,sum(a2.fee) / count(distinct a2.feemsisdn) brjfeefrom rpt.tmp_mm_rb_daily_180ffmx a2where a2.day = from_unixtime(unix_timestamp(date_sub('${hiveconf:CURRENT_DATE}', 2),'yyyy-MM-dd'),'yyyyMMdd')group by a2.day, a2.province_id,a2.province_name, a2.contentid,a2.content_name,a2.fftype ) t2ON (t1.province_id=t2.province_id and t1.contentid = t2.contentid and t1.fftype=t2.fftype);------(当日到前6日付费次数-前7日到前13日付费次数)/前7日到前13日付费次数(times_rose_7days) or (当日到前6日人均付费金额-前7日到前13日人均付费金额)/前7日到前13日人均付费金额(amount_per_head_rose_7days)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb7ortb9;
create table rpt.tmp_mm_rb_daily_tb7ortb9 as
select tt.day,tt.province_id,tt.province_name,tt.contentid,tt.content_name,tt.fftype,IF(t.bffcs is NULL,0,(t.affcs - t.bffcs)/t.bffcs) times_rose_7days,IF(t.brjfee is NULL,0,(t.arjfee - t.brjfee) / t.brjfee ) amount_per_head_rose_7daysfrom rpt.tmp_mm_rb_daily_tb1 ttLEFT OUTER JOIN (SELECT t1.province_id,t1.province_name,t1.contentid,t1.content_name,t1.fftype,t1.affcs,t1.afee,t1.arjfee,t2.bffyhs,t2.bffcs,t2.bfee,t2.brjfee from( select a1.province_id,a1.province_name,a1.contentid,a1.content_name,a1.fftype,sum(a1.ffcs) affcs,sum(a1.fee) afee,sum(a1.fee) / count(distinct a1.feemsisdn) arjfeefrom rpt.tmp_mm_rb_daily_180ffmx a1where a1.day >= date_sub('${hiveconf:CURRENT_DATE}', 7)group by a1.province_id, a1.province_name, a1.contentid,a1.content_name,a1.fftype) t1LEFT OUTER JOIN(select a2.province_id,a2.province_name,a2.contentid,a2.content_name,a2.fftype,count(distinct a2.feemsisdn) bffyhs,sum(a2.ffcs) bffcs,sum(a2.fee) bfee,sum(a2.fee) / count(distinct a2.feemsisdn) brjfeefrom rpt.tmp_mm_rb_daily_180ffmx a2where a2.day >= date_sub('${hiveconf:CURRENT_DATE}', 14)and a2.day < date_sub('${hiveconf:CURRENT_DATE}', 7)group by a2.province_id, a2.province_name, a2.contentid,a2.content_name,a2.fftype) t2ON (t1.province_id=t2.province_id and t1.contentid = t2.contentid and t1.fftype=t2.fftype)) tON (tt.province_id=t.province_id and tt.contentid = t.contentid and tt.fftype=t.fftype);------时间间隔
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_interval;
CREATE TABLE rpt.tmp_mm_rb_daily_interval AS
SELECT A.*,(CASE WHEN A.feemsisdn=LAG(A.feemsisdn) over(partition by a.province_id order by a.cdrtime)AND A.CONTENTID= LAG(A.CONTENTID) over(partition by a.province_id order by a.cdrtime)THEN unix_timestamp(a.cdrtime,'yyyyMMddHHmmss') - lag(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss')) over(partition by a.province_id order by a.cdrtime) END ) in_interval,(CASE WHEN A.feemsisdn=LAG(A.feemsisdn) over(partition by a.province_id order by a.cdrtime)AND A.CONTENTID<> LAG(A.CONTENTID) over(partition by a.province_id order by a.cdrtime)THEN unix_timestamp(a.cdrtime,'yyyyMMddHHmmss') - lag(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss')) over(partition by a.province_id order by a.cdrtime) END ) cross_interval,(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss') - lag(unix_timestamp(a.cdrtime,'yyyyMMddHHmmss')) over(partition by a.province_id order by a.cdrtime)) on_intervalFROM rpt.tmp_mm_rb_daily_ffmx A;------订购间隔时间(in_interval,in_interval_5s_percent,in_interval_120s_percent,in_interval,in_interval_5s_percent,in_interval_120s_percent,charging_point_concentration,cross_interval,cross_interval_5s_percent,cross_interval_120s_percent)
DROP TABLE IF EXISTS rpt.tmp_mm_rb_daily_tb10;
create table rpt.tmp_mm_rb_daily_tb10 as
select a.day,a.province_id,a.province_name,a.contentid,a.content_name,a.fftype,avg(a.in_interval) in_interval,avg(a.cross_interval) cross_interval,avg(a.on_interval) on_interval,count( case when a.in_interval<5 then a.ordernumber end)/count( a.ordernumber) in_interval_5s_percent,count( case when a.in_interval<120 then a.ordernumber end)/count(a.ordernumber) in_interval_120s_percent,count( case when a.cross_interval<5 then a.ordernumber end)/count(a.ordernumber) cross_interval_5s_percent,count( case when a.cross_interval<120 then a.ordernumber end)/count(a.ordernumber) cross_interval_120s_percent,count( case when a.on_interval<5 then a.ordernumber end)/count(a.ordernumber) on_interval_5s_percent,count( case when a.on_interval<120 then a.ordernumber end)/count(a.ordernumber) on_interval_120s_percent
from rpt.tmp_mm_rb_daily_interval agroup by a.day,a.province_id,a.province_name,a.contentid,a.content_name,a.fftype;------整合数据建表
DROP TABLE IF EXISTS rpt.rpt_mm_daily_pay;
create table rpt.rpt_mm_daily_pay as
select t1.day,t1.province_id,t1.province_name,t1.contentid,t1.content_name,t1.fftype,t1.amount,t1.order_number,t1.user_number,t1.avg_amount,t1.amount_per_user,t1.time,t1.time0,t1.time1,t1.time2,t1.time3,t1.time4,t1.time5,t1.time6,t1.new_user_6months1,t1.new_user_6months2,t1.new_user_3months1,t1.new_user_3months2,t1.people_rose_daily,t1.people_rose_7days,t1.amount_per_head_rose_daily,t1.amount_per_head_rose_7days,t1.interval,t1.interval_5s_percent,t1.interval_120s_percent,t1.in_interval,t1.in_interval_5s_percent,t1.in_interval_120s_percent,t1.charging_point_concentration,t1.cross_interval,t1.cross_interval_5s_percent,t1.cross_interval_120s_percentfrom (select t.day,t.province_id,t.contentid,t.content_name,t.province_name,t.fftype,round(sum(t.amount),2) amount,sum(t.order_number) order_number,sum(t.user_number) user_number,round(sum(t.avg_amount), 2) avg_amount,round(sum(t.amount_per_user), 2) amount_per_user,round(sum(t.time),2) time,round(sum(t.time0),2) time0,round(sum(t.time1),2) time1,round(sum(t.time2),2) time2,round(sum(t.time3),2) time3,round(sum(t.time4),2) time4,round(sum(t.time5),2) time5,round(sum(t.time6),2) time6,round(sum(t.new_user_6months1), 2) new_user_6months1,round(sum(t.new_user_6months2), 2) new_user_6months2,round(sum(t.new_user_3months1), 2) new_user_3months1,round(sum(t.new_user_3months2), 2) new_user_3months2,round(sum(t.people_rose_daily), 2) people_rose_daily,round(sum(t.people_rose_7days), 2) people_rose_7days,round(sum(t.amount_per_head_rose_daily), 2) amount_per_head_rose_daily,round(sum(t.amount_per_head_rose_7days), 2) amount_per_head_rose_7days,round(sum(t.on_interval), 2) interval,round(sum(t.on_interval_5s_percent), 2) interval_5s_percent,round(sum(t.on_interval_120s_percent), 2) interval_120s_percent,round(sum(t.in_interval), 2) in_interval,round(sum(t.in_interval_5s_percent), 2) in_interval_5s_percent,round(sum(t.in_interval_120s_percent), 2) in_interval_120s_percent,round(sum(t.charging_point_concentration), 2) charging_point_concentration,round(sum(t.cross_interval), 2) cross_interval,round(sum(t.cross_interval_5s_percent), 2) cross_interval_5s_percent,round(sum(t.cross_interval_120s_percent), 2) cross_interval_120s_percentfrom (select a1.day,a1.province_id,a1.contentid,a1.content_name,a1.province_name,a1.fftype,a1.amount,a1.order_number,a1.user_number,a1.avg_amount,a1.amount_per_user,a1.time,a1.time0,a1.time1,a1.time2,a1.time3,a1.time4,a1.time5,a1.time6,0 new_user_6months1,0 new_user_6months2,0 new_user_3months1,0 new_user_3months2,0 people_rose_daily,0 people_rose_7days,0 amount_per_head_rose_daily,0 amount_per_head_rose_7days,0 on_interval,0 on_interval_5s_percent,0 on_interval_120s_percent,0 in_interval,0 in_interval_5s_percent,0 in_interval_120s_percent,a1.charging_point_concentration,0 cross_interval,0 cross_interval_5s_percent,0 cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb1 a1union ALLselect a2.day,a2.province_id,a2.contentid,a2.content_name,a2.province_name,a2.fftype,0 amount,0 order_number,0 user_number,0 avg_amount,0 amount_per_user,0 time,0 time0,0 time1,0 time2,0 time3,0 time4,0 time5,0 time6,a2.new_user_6months1,0 new_user_6months2,0 new_user_3months1,0 new_user_3months2,0 people_rose_daily,0 people_rose_7days,0 amount_per_head_rose_daily,0 amount_per_head_rose_7days,0 on_interval,0 on_interval_5s_percent,0 on_interval_120s_percent,0 in_interval,0 in_interval_5s_percent,0 in_interval_120s_percent,0 charging_point_concentration,0 cross_interval,0 cross_interval_5s_percent,0 cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb2 a2union ALLselect a3.day,a3.province_id,a3.contentid,a3.content_name,a3.province_name,a3.fftype,0 amount,0 order_number,0 user_number,0 avg_amount,0 amount_per_user,0 time,0 time0,0 time1,0 time2,0 time3,0 time4,0 time5,0 time6,0 new_user_6months1,a3.new_user_6months2,0 new_user_3months1,0 new_user_3months2,0 people_rose_daily,0 people_rose_7days,0 amount_per_head_rose_daily,0 amount_per_head_rose_7days,0 on_interval,0 on_interval_5s_percent,0 on_interval_120s_percent,0 in_interval,0 in_interval_5s_percent,0 in_interval_120s_percent,0 charging_point_concentration,0 cross_interval,0 cross_interval_5s_percent,0 cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb3 a3union ALLselect a4.day,a4.province_id,a4.contentid,a4.content_name,a4.province_name,a4.fftype,0 amount,0 order_number,0 user_number,0 avg_amount,0 amount_per_user,0 time,0 time0,0 time1,0 time2,0 time3,0 time4,0 time5,0 time6,0 new_user_6months1,0 new_user_6months2,a4.new_user_3months1,0 new_user_3months2,0 people_rose_daily,0 people_rose_7days,0 amount_per_head_rose_daily,0 amount_per_head_rose_7days,0 on_interval,0 on_interval_5s_percent,0 on_interval_120s_percent,0 in_interval,0 in_interval_5s_percent,0 in_interval_120s_percent,0 charging_point_concentration,0 cross_interval,0 cross_interval_5s_percent,0 cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb4 a4union ALLselect a5.day,a5.province_id,a5.contentid,a5.content_name,a5.province_name,a5.fftype,0 amount,0 order_number,0 user_number,0 avg_amount,0 amount_per_user,0 time,0 time0,0 time1,0 time2,0 time3,0 time4,0 time5,0 time6,0 new_user_6months1,0 new_user_6months2,0 new_user_3months1,a5.new_user_3months2,0 people_rose_daily,0 people_rose_7days,0 amount_per_head_rose_daily,0 amount_per_head_rose_7days,0 on_interval,0 on_interval_5s_percent,0 on_interval_120s_percent,0 in_interval,0 in_interval_5s_percent,0 in_interval_120s_percent,0 charging_point_concentration,0 cross_interval,0 cross_interval_5s_percent,0 cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb5 a5union ALLselect a6.day,a6.province_id,a6.contentid,a6.content_name,a6.province_name,a6.fftype,0 amount,0 order_number,0 user_number,0 avg_amount,0 amount_per_user,0 time,0 time0,0 time1,0 time2,0 time3,0 time4,0 time5,0 time6,0 new_user_6months1,0 new_user_6months2,0 new_user_3months1,0 new_user_3months2,a6.times_rose_daily people_rose_daily,0 people_rose_7days,a6.amount_per_head_rose_daily,0 amount_per_head_rose_7days,0 on_interval,0 on_interval_5s_percent,0 on_interval_120s_percent,0 in_interval,0 in_interval_5s_percent,0 in_interval_120s_percent,0 charging_point_concentration,0 cross_interval,0 cross_interval_5s_percent,0 cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb6ortb8 a6union ALLselect a7.day,a7.province_id,a7.contentid,a7.content_name,a7.province_name,a7.fftype,0 amount,0 order_number,0 user_number,0 avg_amount,0 amount_per_user,0 time,0 time0,0 time1,0 time2,0 time3,0 time4,0 time5,0 time6,0 new_user_6months1,0 new_user_6months2,0 new_user_3months1,0 new_user_3months2,0 people_rose_daily,a7.times_rose_7days people_rose_7days,0 amount_per_head_rose_daily,a7.amount_per_head_rose_7days amount_per_head_rose_7days,0 on_interval,0 on_interval_5s_percent,0 on_interval_120s_percent,0 in_interval,0 in_interval_5s_percent,0 in_interval_120s_percent,0 charging_point_concentration,0 cross_interval,0 cross_interval_5s_percent,0 cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb7ortb9 a7union ALLselect a8.day,a8.province_id,a8.contentid,a8.content_name,a8.province_name,a8.fftype,0 amount,0 order_number,0 user_number,0 avg_amount,0 amount_per_user,0 time,0 time0,0 time1,0 time2,0 time3,0 time4,0 time5,0 time6,0 new_user_6months1,0 new_user_6months2,0 new_user_3months1,0 new_user_3months2,0 people_rose_daily,0 people_rose_7days,0 amount_per_head_rose_daily,0 amount_per_head_rose_7days,a8.on_interval,a8.on_interval_5s_percent,a8.on_interval_120s_percent,a8.in_interval,a8.in_interval_5s_percent,a8.in_interval_120s_percent,0 charging_point_concentration,a8.cross_interval,a8.cross_interval_5s_percent,a8.cross_interval_120s_percentfrom rpt.tmp_mm_rb_daily_tb10 a8 ) tgroup by t.day, t.province_id, t.province_name,t.contentid,t.content_name,t.fftype) t1order by t1.amount desc;
假定样本集 D {X1, 的,…, Xm} 包含 m 个无标记样本, 每个样本 X (X1; X2;… ; Xn) 是一个 n 维特征向量,则聚类算法将样本 集 D 划分为 k 个不相交的簇 {Gl I l 1, 2;… ,时,其中…
k 近邻(k-Nearest Neighbor,简称 kNN)学习是一种常用的监督学习方法, 其工作机制非常简单: 给定测试样本?基于某种距离度量找出训练集中与其最 靠近的 k 个训练样本,然后基于这 k 个"邻居"的信息来进行预测. 通常, 在分…
k 近邻(k-Nearest Neighbor,简称 kNN)学习是一种常用的监督学习方法, 其工作机制非常简单: 给定测试样本?基于某种距离度量找出训练集中与其最 靠近的 k 个训练样本,然后基于这 k 个"邻居"的信息来进行预测. 通常, 在分…
columns has 234 elements while hbase.columns.mapping has 92 elements (counting the key if implicit))
根本原因: 对于4000个字符,hive Metastore中SERDE_PARAMS表中PARAM_VALUE字段的字符限制是此问题的根本原因。 此限制可防止Hive创建具有高列数…
Mybatis中#{}和${} 1、#{}将传入的数据都当成一个字符串,会对自动传入的数据加一个引号(单引号?双引号?加了引号就对了)如:
//传入的值是sex order by #{column} 解析后为
order by “sex” //将会出错 2…
Data
NoArgsConstructor
public class PageUtil implements Serializable {private static final long serialVersionUID 1L;/*** 总记录数*/private int totalCount;/*** 每页记录数*/private int pageSize;/*** 总页数*/private int totalPage;/*** 当前页数*/private int c…