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

相关推荐
崖边看雾21 小时前
Hadoop —— HDFS 写数据流程
大数据·hadoop·hdfs
崖边看雾21 小时前
Hadoop —— HDFS 读流程
大数据·hadoop·hdfs
磁场转动100万匹1 天前
HDFS 与 MapReduce 核心原理详解
hadoop·hdfs·mapreduce
Gl�ria2 天前
Hadoop MapReduce/Hive 数据倾斜完整排查
hive·hadoop·mapreduce
Gl�ria2 天前
Hadoop Hive 和 YARN 的关系
数据仓库·hive·hadoop
ha_lydms4 天前
HDFS 简介
大数据·hadoop·hdfs·yarn·调度·aliyun·计算
ha_lydms5 天前
HDFS的读写流程
大数据·hadoop·hdfs·mapreduce·yarn·maxcompute·odps
fastjson_6 天前
Hive 自定义函数
数据仓库·hive·hadoop
Gent_倪6 天前
MySQL 与 Hive 语法异同点详解
数据库·hive·mysql
邀星月为媒9 天前
从零打造一个属于自己的 AI Agent:Core Hive Agent 开源项目解析
人工智能·hive·开源