sqoop导入hdfs,hive

sqoop将mysql中的表导入到hdfs中

复制代码
sqoop import \
> --connect jdbc:mysql://192.168.52.150/test \
> --username root \
> --password 123456 \
> --table emp \
> --delete-target-dir \
> --target-dir '/sqoop_works/emp_1'


将数据导入hive中,首先要在hive中创建目标表

复制代码
create database hivesqoop;
use hivesqoop;
create table hivesqoop.emp_add_hive(
    id int,
    hon string,
    street string,
    city string
)
row format delimited fields terminated by '\t'
stored as orc;

然后导入

复制代码
 sqoop import --connect jdbc:mysql://192.168.52.150/test --username root --password 123456 --table emp_add --hcatalog-database hivesqoop --hcatalog-table emp_add_hive -m 1

将增量数据导入hdfs中

加上 --where id >= 120

hive导出到MySQL 是换个方向。

相关推荐
洛克大航海11 小时前
Ubuntu中使用Hadoop的HDFS和MapReduce
hadoop·ubuntu·hdfs·mapreduce
夫唯不争,故无尤也17 小时前
Maven创建Java项目实战全流程
java·数据仓库·hive·hadoop·maven
yumgpkpm2 天前
CMP (类Cloudera) CDP7.3(400次编译)在华为鲲鹏Aarch64(ARM)信创环境中的性能测试过程及命令
大数据·hive·hadoop·python·elasticsearch·spark·cloudera
yumgpkpm2 天前
大数据综合管理平台(CMP)(类Cloudera CDP7.3)有哪些核心功能?
hive·hadoop·elasticsearch·zookeeper·big data
板凳坐着晒太阳2 天前
Hive 删除分区语句卡死问题
数据仓库·hive·hadoop
嘉禾望岗5032 天前
hive on tez运行及hive ha搭建
数据仓库·hive·hadoop
hrrrrb3 天前
【Spring Security】Spring Security 密码编辑器
java·hive·spring
二进制_博客3 天前
spark on hive 还是 hive on spark?
大数据·hive·spark
D明明就是我4 天前
Hive 知识点梳理
数据仓库·hive·hadoop
dessler5 天前
Elasticsearch(ES)简介与入门
linux·运维·hdfs