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 是换个方向。

相关推荐
知初~10 小时前
出行项目案例
hive·hadoop·redis·sql·mysql·spark·database
轩昂7K1 天前
sqoop的sql语言导入方式
前端·sql·sqoop
我要用代码向我喜欢的女孩表白2 天前
hive迁移补数脚本细粒度 表名-分区唯一键
数据仓库·hive·hadoop
隔壁老登2 天前
查询hive指定数据库下所有表的建表语句并生成数据字典
数据库·hive·hadoop
一张假钞3 天前
MapReduce 读取 Hive ORC ArrayIndexOutOfBoundsException: 1024 异常解决
大数据·hive·mapreduce
python资深爱好者3 天前
Hive中的分区和桶的概念及其作用
数据仓库·hive·hadoop
Beekeeper&&P...4 天前
Spring Security,servlet filter,和白名单之间的关系
hive·spring·servlet
我要用代码向我喜欢的女孩表白4 天前
hive(hdfs)补数脚本
数据仓库·hive·hadoop
宝哥大数据4 天前
Hive--map join
hive
风子~4 天前
hive—常用的函数整理
数据仓库·hive·hadoop