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
相关推荐
倔强的石头_1 分钟前
金仓多模数据库平替 MongoDB:电子证照国产化的技术实操与价值突破
数据库
Go高并发架构_王工5 分钟前
MySQL性能优化案例分析:从问题到解决方案
数据库·mysql·性能优化
没有bug.的程序员7 分钟前
云原生与分布式架构的完美融合:从理论到生产实践
java·分布式·微服务·云原生·架构
JAVA学习通26 分钟前
开源 | MeiGen-MultiTalk:基于单张照片实现多人互动演绎
大数据·音视频·视频
二十三之歌28 分钟前
Redis 中文学习手册
数据库·redis·学习
JanelSirry35 分钟前
分布式和微服务的区别是什么?
分布式·微服务·架构
忧郁火龙果39 分钟前
六、Hive的基本使用
数据仓库·hive·hadoop
徐子童39 分钟前
基于微服务的在线判题系统重点总结
java·微服务·架构
web安全工具库1 小时前
告别刀耕火种:用 Makefile 自动化 C 语言项目编译
linux·运维·c语言·开发语言·数据库·算法·自动化
金纬软件11 小时前
电脑监控软件有哪些?企业监控软件应该怎么选?
大数据·运维