暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

离线数仓常用工具-sqoop(2)HDFS->MySQL

趣说大数据 2021-02-19
298
01

HDFS到MySQL(非分区表)

mysql_table=mysql_crawl;
hive_db=default;
hive_table=mysql_crawl1;
sqoop export \
--connect jdbc:mysql://xx.xx.xx.32:3306/flink_config \
--username 'root' \
--password 'aswerd' \
--null-string '\\N' \
--null-non-string '\\N' \
--table ${mysql_table} \
--hcatalog-database ${hive_db} \
--hcatalog-table ${hive_table} \
-m 2
复制


02

HDFS到MySQL(分区表)


mysql_table=mysql_crawl;
hive_db=default;
hive_table=mysql_crawl1;
d_date=2021-01-17;
p_type=DD;
sqoop export \
--connect jdbc:mysql://xx.xx.xx.32:3306/flink_config \
--username 'root' \
--password 'aswerd' \
--null-string '\\N' \
--null-non-string '\\N' \
--table ${mysql_table} \
--hcatalog-database ${hive_db} \
--hcatalog-table ${hive_table} \
--hcatalog-partition-keys d_date,p_type \
--hcatalog-partition-values ${d_date},${p_type} \
-m 2
复制
文章转载自趣说大数据,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论