hive表建表
Posted hymmiaomiao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hive表建表相关的知识,希望对你有一定的参考价值。
create table hw_etl_data_201803_tmp(
DtchPrbAssnMeanUl_Rate double,
DtchPrbAssnMeanUl double,
PRB_Ul_Avail double,
PRB_CONInfMeanUl_Rate double,
PRB_CONInfMeanUl double,
DtchPrbAssnMeanDl_Rate double,
DtchPrbAssnMeanDl double,
PRB_Dl_Avail double,
PRB_CONInfMeanDl_Rate double,
PRB_CONInfMeanDl double,
PuschPrbTotMeanUl_Rate double,
PuschPrbTotMeanUl double,
PuschPrbTotMeanDl_Rate double,
PuschPrbTotMeanDl double,
PDCCH_CCE_Occupied_Rate double,
PDCCH_CCE_Occupied double,
PDCCH_CCE_Assigned double,
PRACH_Occupied_Rate string,
PRACH_PreDetected double,
PRACH_NonPreDetected double,
PRACH_UsePre string,
PRACH_UseNonPre string,
PRACH_NonPreOccupied_Rate string,
Paging_Occupied_Rate string,
Paging_Capacity string,
RRC_UserConnMax double,
RRC_UserConnMean double,
Traffic_ActUserUl double,
Traffic_ActUserDl double,
Traffic_ActUserMean double,
Traffic_ActUserMax double,
CFI3SubFrameNum double,
CFI1_2_3SubFrameNum double,
CFI3SubFrameRate double,
RRC_AttConnEstab_UE double,
RRC_SuccConnEstab_UE double,
RRC_SuccConnEstab_UE_Rate double,
RRC_AttConnEstab_Net double,
RRC_SuccConnEstab_Net double,
RRC_SuccConnEstab_Net_Rate double,
RRC_SuccConnEstab_Rate double,
RRC_FailConnEstab_UeNoReply double,
RRC_FailConnEstab_CellReject double,
RRC_FailConnEstab_OtherCause double,
RRC_AttConnReestab double,
RRC_SuccConnReestab double,
RRC_SuccConnReestab_Rate double,
S1Sig_AttConnEstab double,
S1Sig_SuccConnEstab double,
S1Sig_SuccConnEstab_Rate double,
ERAB_InitAttEstab double,
ERAB_InitSuccEstab double,
ERAB_AddAttEstab double,
ERAB_AddSuccEstab double,
Radio_SuccConn_Rate string,
Paging_S1_Rx double,
Paging_Discard_Num double,
Paging_Cong_Rate double,
RRC_ConnReestab_Rate double,
CQI0 double,
CQI1 double,
CQI2 double,
CQI3 double,
CQI4 double,
CQI5 double,
CQI6 double,
CQI7 double,
CQI8 double,
CQI9 double,
CQI10 double,
CQI11 double,
CQI12 double,
CQI13 double,
CQI14 double,
CQI15 double,
UECNTX_AbnormRel double,
UECNTX_NormRel double,
UECNTX_Drop_Rate double,
ERAB_AbnormRel double,
ERAB_NormRel double,
ERAB_Drop_Rate double,
DRB_DSLTimeCellUl double,
DRB_DSLTimeCellDl double,
HO_AttOutIntraEnb double,
HO_SuccOutIntraEnb double,
HO_SuccOutIntraEnb_Rate double,
HO_AttOutX2 double,
HO_SuccOutX2 double,
HO_SuccOutX2_Rate double,
HO_AttOutS1 double,
HO_SuccOutS1 double,
HO_SuccOutS1_Rate double,
HO_SuccOutInterEnb_Rate double,
HO_SuccOutIntraMode_Rate double,
HO_AttOutLTETo3G double,
PDCP_SduOctUl double,
PDCP_SduPktUl double,
PDCP_SduOctDl double,
PDCP_SduPktDl double,
UEXP_MeanSpeedUl double,
UEXP_MeanSpeedUl_QCI1 string,
UEXP_MeanSpeedUl_QCI2 string,
UEXP_MeanSpeedUl_QCI3 string,
UEXP_MeanSpeedUl_QCI4 string,
UEXP_MeanSpeedUl_QCI5 string,
UEXP_MeanSpeedUl_QCI6 string,
UEXP_MeanSpeedUl_QCI7 string,
UEXP_MeanSpeedUl_QCI8 string,
UEXP_MeanSpeedUl_QCI9 string,
UEXP_MeanSpeedDl double,
UEXP_MeanSpeedDl_QCI1 double,
UEXP_MeanSpeedDl_QCI2 double,
UEXP_MeanSpeedDl_QCI3 double,
UEXP_MeanSpeedDl_QCI4 double,
UEXP_MeanSpeedDl_QCI5 double,
UEXP_MeanSpeedDl_QCI6 double,
UEXP_MeanSpeedDl_QCI7 double,
UEXP_MeanSpeedDl_QCI8 double,
UEXP_MeanSpeedDl_QCI9 double,
PDCP_SduLossPktUl double,
PDCP_SduLossPktUl_Rate double,
PDCP_SduLossPktDl double,
PDCP_SduLossPktDl_Rate double,
PDCP_SduTotDelayDl double,
PDCP_SduMeanDelayDl double,
Cell_UnServ_Time double,
Cell_ServTime_Rate double,
ERAB_InitAttEstab_QCI1 double,
ERAB_InitSuccEstab_QCI1 double,
ERAB_AddAttEstab_QCI1 double,
ERAB_AddSuccEstab_QCI1 double,
ERAB_SuccEstab_QCI1_Rate double,
ERAB_InitAttEstab_QCI5 double,
ERAB_InitSuccEstab_QCI5 double,
ERAB_AddAttEstab_QCI5 double,
ERAB_AddSuccEstab_QCI5 double,
ERAB_SuccEstab_QCI5_Rate double,
ERAB_AbnormRel_QCI1 double,
ERAB_NormRel_QCI1 double,
ERAB_Drop_QCI1_Rate double,
ERAB_AbnormRel_QCI5 double,
ERAB_NormRel_QCI5 double,
ERAB_Drop_QCI5_Rate double,
PDCP_TotThrpUl_QCI1 double,
PDCP_ThrpTimeUl_QCI1 double,
PDCP_ThrpRateUl_QCI1 double,
PDCP_TotThrpDl_QCI1 double,
PDCP_ThrpTimeDl_QCI1 double,
PDCP_ThrpRateDl_QCI1 double,
HO_AttOutIntraEnbIntraFreq_QCI1 double,
HO_SuccOutIntraEnbIntraFreq_QCI1 double,
HO_SuccOutIntraEnbsameFreq_QCI1_Rate double,
HO_AttOutIntraEnbInterFreq_QCI1 double,
HO_SuccOutIntraEnbInterFreq_QCI1 double,
HO_SuccOutIntraEnbInterFreq_QCI1_Rate double,
HO_AttOutInterEnbIntraFreq_QCI1 double,
HO_SuccOutInterEnbIntraFreq_QCI1 double,
HO_SuccOutInterEnbsameFreq_QCI1_Rate double,
HO_AttOutInterEnbInterFreq_QCI1 double,
HO_SuccOutInterEnbInterFreq_QCI1 double,
HO_SuccOutInterEnbInterFreq_QCI1_Rate double,
VoIP_UsrNum_Mean double,
VoIP_UsrNum_Max double
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ‘,‘
STORED AS Textfile
LOCATION
‘/zxvmax/telecom/lte/hw_etl_data_201803_tmp‘
ALTER TABLE hw_data_201803_tmp CHANGE Cell_ServTime_Rate Cell_ServTime_Rate string;
insert into table hw_etl_data_201803_tmp
select
C1526728762/C1526728434
,C1526728762
,C1526728434
,(C1526726737-C1526728762)/C1526728434
,C1526726737-C1526728762
,C1526728763/C1526728433
,C1526728763
,C1526728433
,(C1526726740-C1526728763)/C1526728433
,C1526726740-C1526728763
,C1526726737/C1526728434
,C1526726737
,C1526726740/C1526728433
,C1526726740
,0
,C1526728303+C1526728304+C1526728305
,0
,‘20180327‘
,C1526727215+C1526727218
,C1526727221
,‘20180327‘
,‘20180327‘
,‘20180327‘
,‘C1526726884/(1200*[gp]*60)‘
,‘1200*[gp]*60‘
,C1526727379
,C1526727378
,C1526728972
,C1526728969
,C1526728975
,C1526728976
,0
,0
,0
,C1526726658-C1526728219
,C1526726659-C1526728224
,C1526726659-C1526728224)/(C1526726658-C1526728219)
,C1526728219
,C1526728224
,C1526728224/C1526728219
,C1526726659/C1526726658
,C1526727084
,C1526728269
,C1526726658-C1526726659)-(C1526727084+C1526728269)
,C1526727085
,C1526727086
,C1526727086/C1526727085
,C1526728272
,C1526728273
,C1526728273/C1526728272
,C1526728274
,C1526728275
,C1526727545-C1526728274
,C1526727544-C1526728275
,‘C373‘
,C1526726884
,C1526727212+C1526728521
,(C1526727212+C1526728521)/C1526726884
,C1526727085/(C1526726659-C1526728224+C1526728224+C1526727086)
,C1526729319+C1526729335+C1526729351+C1526729367+C1526729383+C1526729399
,C1526729320+C1526729336+C1526729352+C1526729368+C1526729384+C1526729400
,C1526729321+C1526729337+C1526729353+C1526729369+C1526729385+C1526729401
,C1526729322+C1526729338+C1526729354+C1526729370+C1526729386+C1526729402
,C1526729323+C1526729339+C1526729355+C1526729371+C1526729387+C1526729403
,C1526729324+C1526729340+C1526729356+C1526729372+C1526729388+C1526729404
,C1526729325+C1526729341+C1526729357+C1526729373+C1526729389+C1526729405
,C1526729326+C1526729342+C1526729358+C1526729374+C1526729390+C1526729406
,C1526729327+C1526729343+C1526729359+C1526729375+C1526729391+C1526729407
,C1526729328+C1526729344+C1526729360+C1526729376+C1526729392+C1526729408
,C1526729329+C1526729345+C1526729361+C1526729377+C1526729393+C1526729409
,C1526729330+C1526729346+C1526729362+C1526729378+C1526729394+C1526729410
,C1526729331+C1526729347+C1526729363+C1526729379+C1526729395+C1526729411
,C1526729332+C1526729348+C1526729364+C1526729380+C1526729396+C1526729412
,C1526729333+C1526729349+C1526729365+C1526729381+C1526729397+C1526729413
,C1526729334+C1526729350+C1526729366+C1526729382+C1526729398+C1526729414
,C1526728227
,C1526728228
,C1526728227/(C1526728227+C1526728228)
,C1526727546
,C1526727547
,C1526727546/(C1526727546+C1526727547)
,C1526728998
,C1526728997
,C1526726995+C1526726998
,C1526726997+C1526727000
,(C1526726997+C1526727000)/(C1526726995+C1526726998)
,C1526727264+C1526727267
,C1526727266+C1526727269
,(C1526727266+C1526727269)/(C1526727264+C1526727267)
,(C1526727001+C1526727004)-(C1526727264+C1526727267)
,(C1526727003+C1526727006)-(C1526727266+C1526727269)
,((C1526727003+C1526727006)-(C1526727266+C1526727269))/((C1526727001+C1526727004)-(C1526727264+C1526727267))
,((C1526727003+C1526727006)-(C1526727266+C1526727269)+C1526727266+C1526727269)/((C1526727001+C1526727004)-(C1526727264+C1526727267)+C1526727264+C1526727267)
,(C1526726997+C1526727000+(C1526727003+C1526727006)-(C1526727266+C1526727269)+C1526727266+C1526727269)/(C1526726995+C1526726998+(C1526727001+C1526727004)-(C1526727264+C1526727267)+C1526727264+C1526727267)
,C1526729426
,C1526728259/8/1000000
,C1526727962+C1526727965+C1526727968+C1526727971+C1526727974+C1526727977+C1526727980+C1526727983+C1526727986
,C1526728261/8/1000000
,C1526727935+C1526727938+C1526727941+C1526727944+C1526727947+C1526727950+C1526727953+C1526727956+C1526727959
,(C1526728259/8/1000000-C1526729049/8/1000000)*8/(C1526728260-(C1526728260-C1526729050)/1000)
,‘20180327‘
,‘20180327‘
,‘20180327‘
,‘20180327‘
,‘20180327‘
,‘20180327‘
,‘20180327‘
,‘20180327‘
,‘20180327‘
,(C1526728261/8/1000000-C1526729005/8/1000000)*8/((C1526728262-(C1526728262-C1526729015))/1000)
,(C1526726803/8/1000000-C1526729006/8/1000000)*8/((C1526726804-(C1526726804-C1526729016))/1000)
,(C1526726806/8/1000000-C1526729007/8/1000000)*8/((C1526726807-(C1526726807-C1526729017))/1000)
,(C1526726809/8/1000000-C1526729008/8/1000000)*8/((C1526726810-(C1526726810-C1526729018))/1000)
,(C1526726812/8/1000000-C1526729009/8/1000000)*8/((C1526726813-(C1526726813-C1526729019))/1000)
,(C1526726815/8/1000000-C1526729010/8/1000000)*8/((C1526726816-(C1526726816-C1526729020))/1000)
,(C1526726818/8/1000000-C1526729011/8/1000000)*8/((C1526726819-(C1526726819-C1526729021))/1000)
,(C1526726821/8/1000000-C1526729012/8/1000000)*8/((C1526726822-(C1526726822-C1526729022))/1000)
,(C1526726824/8/1000000-C1526729013/8/1000000)*8/((C1526726825-(C1526726825-C1526729023))/1000)
,(C1526726827/8/1000000-C1526729014/8/1000000)*8/((C1526726828-(C1526726828-C1526729024))/1000)
,C1526727961+C1526727964+C1526727967+C1526727970+C1526727973+C1526727976+C1526727979+C1526727982+C1526727985
,(C1526727961+C1526727964+C1526727967+C1526727970+C1526727973+C1526727976+C1526727979+C1526727982+C1526727985)/(C1526727962+C1526727965+C1526727968+C1526727971+C1526727974+C1526727977+C1526727980+C1526727983+C1526727986)
,C1526727934+C1526727937+C1526727940+C1526727943+C1526727946+C1526727949+C1526727952+C1526727955+C1526727958
,(C1526727934+C1526727937+C1526727940+C1526727943+C1526727946+C1526727949+C1526727952+C1526727955+C1526727958)/(C1526727935+C1526727938+C1526727941+C1526727944+C1526727947+C1526727950+C1526727953+C1526727956+C1526727959)
,C1526727907+C1526727910+C1526727913+C1526727916+C1526727919+C1526727922+C1526727925+C1526727928+C1526727931
,(C1526727907+C1526727910+C1526727913+C1526727916+C1526727919+C1526727922+C1526727925+C1526727928+C1526727931)/(C1526727935+C1526727938+C1526727941+C1526727944+C1526727947+C1526727950+C1526727953+C1526727956+C1526727959)
,C1526727209+C1526727210+C1526728493
,‘([gp]*60*1-(C1526727209+C1526727210+C1526728493))/([gp]*60*1)‘
,C1526728192
,C1526728193
,C1526726668-C1526728192
,C1526726669-C1526728193
,C1526726669/C1526726668
,C1526728200
,C1526728201
,C1526726676-C1526728200
,C1526726677-C1526728201
,C1526726677/C1526726676
,C1526726686
,C1526726687
,C1526726686/(C1526726686+C1526726687)
,C1526726694
,C1526726695
,C1526726694/(C1526726694+C1526726695)
,C1526726776
,C1526726777
,C1526726776/C1526726777
,C1526726803
,C1526726804
,C1526726803/C1526726804
,C1526729526
,C1526729532
,C1526729532/C1526729526
,C1526729527
,C1526729533
,C1526729533/C1526729527
,C1526729535
,C1526729541
,C1526729541/C1526729535
,C1526729536
,C1526729542
,C1526729542/C1526729536
,C1526732721
,C1526732722
from hw_data_201803_tmp
以上是关于hive表建表的主要内容,如果未能解决你的问题,请参考以下文章