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

相关推荐
赤土 炙焱6 天前
hiveserver2启动失败,磁盘满了
hive·hadoop
Francek Chen6 天前
【大数据处理与分析】数据仓库Hive:02 数据湖
大数据·数据仓库·hive·hadoop·分布式·数据分析
我要用代码向我喜欢的女孩表白9 天前
hdfs获取所有路径大小的脚本
大数据·hadoop·hdfs
Waay9 天前
什么是HBase?它和Hive有什么区别?
大数据·数据库·hive·hadoop·hdfs·hbase
fastjson_10 天前
Hive的介绍和使用
数据仓库·hive·hadoop
William Dawson15 天前
【踩坑实录|Hive1\.2\.1数据服务接口5大疑难问题调试与全方位优化方案】
java·hive·spring boot
牛奶咖啡1322 天前
大数据Hadoop运维应用实践——HIVE与Hadoop实现整合_Hive的配置安装与使用
大数据·hive·hive的配置与安装·metastore服务的配置·hiveserver2服务配置·hive的常用sql操作·beeline的使用
向夏威夷 梦断明暄24 天前
基于Tez引擎的 Hive SQL 性能优化
hive·sql·性能优化
humbinal1 个月前
同时支持 gui & cli 的 parquet 文件查看工具,高性能小清新!
hive·python·rust·spark·开源·github·parquet
吾AI科技1 个月前
基于Tez引擎的 Hive SQL 性能优化
大数据·hive·性能优化·tez