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

相关推荐
TTBIGDATA7 小时前
【Ambari Plus】13.Spark 安装
大数据·hadoop·分布式·spark·ambari·sqoop·ambari plus
AllData公司负责人10 小时前
数据集成管理|AIIData数据中台实现MySQL、Hive、Oracle一键接入Doris
大数据·数据库·人工智能·hive·mysql·oracle·数据分析
泰克教育官方账号12 小时前
泰涨知识 | Hive集群环境部署
数据仓库·hive·hadoop
婉然从物14 小时前
Flink SQL 元数据持久化实战:从“每次重启表消失”到“Hive Metastore 永久存储”
hive·sql·flink
龙石数据1 天前
MySQL 全量同步到 Hive 怎么做?三步配置教程
数据库·hive·mysql·数据治理·数据中台
心中有国也有家1 天前
E-Brufen 技术选型全景:Flutter + 鸿蒙 + Hive CE
hive·hadoop·学习·flutter·华为·harmonyos
DataPulse*2 天前
Hive常用参数调优十二板斧
hive·hadoop·硬件架构
TTBIGDATA2 天前
【Ambari Plus】12.Flink 安装
hive·hadoop·flink·ambari·hdp·cdh·bigtop
心中有国也有家2 天前
Flutter 鸿蒙适配第一步:从 hive 迁移到 hive\_ce
hive·学习·flutter·华为·harmonyos
心中有国也有家2 天前
鸿蒙 Flutter 本地存储实战:Hive CE 从入门到精讲
人工智能·hive·flutter·华为·harmonyos