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

相关推荐
小四的快乐生活12 小时前
Hive 存储管理测试用例设计指南
hive·hadoop·测试用例
PawSQL1 天前
十年磨一剑!Apache Hive 性能优化演进全史(2013 - )
大数据·hive·性能优化
越来越无动于衷1 天前
Spring Boot 整合 Spring MVC:自动配置与扩展实践
数据仓库·hive·hadoop
君不见,青丝成雪3 天前
Hadoop技术栈(四)HIVE常用函数汇总
大数据·数据库·数据仓库·hive·sql
yatingliu20194 天前
HiveQL | 个人学习笔记
hive·笔记·sql·学习
步行cgn6 天前
在 HTML 表单中,name 和 value 属性在 GET 和 POST 请求中的对应关系如下:
前端·hive·html
喂完待续6 天前
【Tech Arch】Hive技术解析:大数据仓库的SQL桥梁
大数据·数据仓库·hive·hadoop·sql·apache
dessler8 天前
Hadoop HDFS-部署和基本操作
linux·运维·hdfs
beijingliushao9 天前
33-Hive SQL DML语法之查询数据-2
hive·hadoop·sql
让头发掉下来9 天前
Hive 创建事务表的方法
大数据·hive·hadoop