05-用户画像+mysql-hive数据导入

将用户数据导入数仓

新建 create_hive_table.sh文件

在终端执行以下文件

sh create_hive_table.sh

sql 复制代码
sqoop create-hive-table \
--connect jdbc:mysql://up01:3306/tags_dat \    tags_dat库名
--username root \       root 用户名
--password 123456 \    123456  密码
--table tbl_users \     tbl_users表名
--hive-database db_ods  \    db_ods  hive数据库库名
--hive-table tbl_users      tbl_users  表名

wait

sqoop create-hive-table \
--connect jdbc:mysql://up01:3306/tags_dat \
--username root \
--password 123456 \
--table tbl_goods \
--hive-database db_ods  \
--hive-table tbl_goods

wait

sqoop create-hive-table \
--connect jdbc:mysql://up01:3306/tags_dat \
--username root \
--password 123456 \
--table tbl_logs \
--hive-database db_ods  \
--hive-table tbl_logs

wait

sqoop create-hive-table \
--connect jdbc:mysql://up01:3306/tags_dat \
--username root \
--password 123456 \
--table tbl_orders \
--hive-database db_ods  \
--hive-table tbl_orders

导入脚本

sql 复制代码
 sqoop import \
 --connect jdbc:mysql://up01:3306/tags_dat \
 --username root \
 --password 123456 \
 --table tbl_users \
 --hive-import \
 --hive-overwrite \
 --hive-database db_ods  \
 --hive-table tbl_users \
 --delete-target-dir \
 -m 2

 wait

sqoop import \
 --connect jdbc:mysql://up01:3306/tags_dat \
 --username root \
 --password 123456 \
 --table tbl_goods \
 --hive-import \
 --hive-overwrite \
 --hive-database db_ods  \
 --hive-table tbl_goods \
 --delete-target-dir \
 -m 2

wait

sqoop import \
 --connect jdbc:mysql://up01:3306/tags_dat \
 --username root \
 --password 123456 \
 --table tbl_logs \
 --hive-import \
 --hive-overwrite \
 --hive-database db_ods  \
 --hive-table tbl_logs \
 --delete-target-dir \
 -m 2

wait

sqoop import \
 --connect jdbc:mysql://up01:3306/tags_dat \
 --username root \
 --password 123456 \
 --table tbl_orders \
 --hive-import \
 --hive-overwrite \
 --hive-database db_ods  \
 --hive-table tbl_orders \
 --delete-target-dir \
 -m 2
相关推荐
User_芊芊君子41 分钟前
【金仓数据库征文】金仓数据库KingbaseES:在技术与人文交织中开拓信创未来
数据库·数据库平替用金仓·金仓数据库2025征文
gs8014043 分钟前
深度解析:从12306看混合云架构下的高并发系统设计
架构·12306
weixin_307779132 小时前
分层设计数据仓库的架构和设计高效数据库系统的方法
数据仓库·架构
傻啦嘿哟2 小时前
Python正则表达式:用“模式密码“解锁复杂字符串
linux·数据库·mysql
计算机毕设定制辅导-无忧学长3 小时前
TDengine 集群高可用方案设计(一)
大数据·时序数据库·tdengine
辰哥单片机设计4 小时前
JW01三合一传感器详解(STM32)
数据库·mongodb
小刘同学++4 小时前
Qt使用 SQLite 数据库的基本方法
数据库·qt·sqlite
喝拿铁写前端6 小时前
从圣经Babel到现代编译器:没开玩笑,普通程序员也能写出自己的编译器!
前端·架构·前端框架
技术项目引流6 小时前
elasticsearch查询中的特殊字符影响分析
大数据·elasticsearch·搜索引擎