人口统计主题数据库.docx

上传人:夺命阿水 文档编号:522676 上传时间:2025-07-29 格式:DOCX 页数:6 大小:13.36KB
下载 相关 举报
人口统计主题数据库.docx_第1页
第1页 / 共6页
人口统计主题数据库.docx_第2页
第2页 / 共6页
人口统计主题数据库.docx_第3页
第3页 / 共6页
人口统计主题数据库.docx_第4页
第4页 / 共6页
人口统计主题数据库.docx_第5页
第5页 / 共6页
点击查看更多>>
资源描述

1、人口统计在hive路径下:1 启动服务binive-servicemetastore&2 :启动hive:bin/hrve# 建库createdatabasedzxktj;# 进摩usedz-rkt;# 建表1createtab1.etb_ana1.ysis_of_f1.oating_popu1.ation(idit.regionstring,f1.oatingpopu1.ationstring)rowformatde1.imitedfie1.dsterminatedbyt;# 建表2Createtab1.etb_age_gender(idint.sectionstring,numberofp

2、eop1.estring,numberofboysstng,numberoffema1.estudentsstring)rowformatde1.imitedfie1.dsterminatedbyt;# 建表3createtab1.etb_an1.yss(idint.sourcenamestring.numberstring)rowformatde1.imitedfie1.dsterminatedbyt;# 建表4createtab1.etb_annua1.1._nationa1.(dint.particu1.arstring.umbeob1.e_rea1._time_user_statist

3、ics(dint.timestring.umbeofpeop1.estring)rowformatde1.mrtedfie1.dsterminatedbyt,;# 建表7createtab1.etb_statistics_working(idint.regionstring.numbefofresidentsstring.numberOfworkersstring)rowformatde1.imitedfie1.dsterminatedby,f:# 建表8Createtab1.etb_working_USeJstatistics(dint.nameofdtstrictstring.number

4、ofpeop1.estring)rowformatde1.imitedfie1.dsterminatedby,f;# 数据迁移1在SqOOP目录下:bin/sqoopimport-connectjdbcmysqyhadoop2.3306dzxrktj-usernameroot-passwordroot-tab1.etb_ana1.ysis_of_fIoating_popu1.ation-num-mappers1-hre-import-hwe-databasedzx.rkt-hve-tab1.etb_ana1.ysis_of_f1.oating_popu1.ation-fie1.ds-termi

5、ated-byAf-de1.ete-target-dir#数据迁移2在sqoop目录下bin/sqoopimport-connectjdbmysqhadoop2-3306dz-rktj-usernameroot-passwordroot-tab1.etb_age_gender-num-mappers1-hive-import-hive-databasedzx_rktj-hve-tab1.etb_age_gender-fie1.ds-terminated-byf-de1.ete-targetdir#数据迁移3在sqoop目录下:bin/sqoopimport-connectjdbcmysqiy/

6、hadoop2.3306/dzx_rktj-usernameroot-passwordroot-tab1.etb_anfysis-num-mappers1-hrve-import-hrve-databasedzx.rktj-hive-tabteManIySiS-fie1.ds-terminated-byf-detete-target-dir#数据迁移4在sqoop目录下bin/sqoopimport-connectjdbcmysq1.hadoop23306dzx-rktj-usernameroot-passwordroot-tab1.etb_annua1.1._nationa1.-num-ma

7、ppers1-hive-import-hive-databasedzx_rktj-hive-tab1.etb_annua1.1._nationa1.-fie1.ds-terminated-byV-de1.ete-target-dir#数据迁移5在SqOOP目录下:bin/sqoopimport-connectjdbcmysq1.hadoop2.3306dzxrktj-usernameroot-passwordroot-tab1.etb_demographic-num-mappers1-hre-import-hive-databasedzxkt-hive-tab1.etb_demographic

8、fie1.ds-terminated-byM-detete-target-dir#数据迁移6在sqoop目录下bnsqoopimport-connectjdbcmysqhadoop2-3306dz-rktj-usenameroot-passwordroot-tab1.etb_mobi1.e_fea1._time_user_statistics-num-mappers1-hive-import-hive-databasedzxjktj-hrve-tabtetb_mobi1.e_rea1._time_user_statisticsfie1.ds-termnated-byAf-de1.ete-ta

9、rget-dir#数据迁移7在sqoop目录下:bin/sqoopimport-connectjdbc:mysq1./hadoop2.3306/dzxrktj-usernameroot-passwordroot-tab1.etb_statistics_working-num-mappers1-hrve-import-hwe-databasedzxkt-hive-tab1.etb_statstics_working-fie1.ds-terminated-byAf-detete-target-dir#数据迁移8在sqoop目录下bin/sqoopimport-connectjdbcmysq1.ha

10、doop23306dz-rktj-usernameroot-passwordroot-tab1.etb_v/orking_user_statistics-num-mappers1-hive-import-hive-databasedzx_rktj-hive-tab1.eIbJVorking_USeJStatiStieS-fie1.ds-terminated-byV-de1.ete-target-dir查询1se1.ect*fromtb_ana1.ysis_ofj1.oating_popu1.ation:查询2se1.ect*fromtb_age_gender;查询3se1.ectfromtb.an1.ysis;查询4se1.ect*fromMannUaI1.naUOnaI;查询5se1.ectfromtb_demographic;查询6se1.ect*fromtb_mobi1.e_rea1.jime_user_siatistics.查询7se1.ect*fromtbstatistics.working;查询8se1.ect*fromtb_Working_USeJStattStics;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 研究报告 > 统计年鉴/数据分析

宁ICP备18001539号-1