栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

sqoop import query

sqoop import query

1、非分区表

sqoop import 
 --connect 'jdbc:mysql://node03:3306/zp_sys?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8&tinyInt1isBit=false&CatalogOptions=0;NumberPrecisionScale=1' 
 --username root 
 --password 'Changxin*8' 
 --query "select *  from sys_file_depot where 1=1  and $CONDITIONS " 
 --hive-import  
 --as-textfile 
 --null-string '\N' 
 --null-non-string '\N' 
 --hive-overwrite   
 --delete-target-dir  
 --target-dir /user/hive/warehouse/rcdn_stg/stg_rcdn_sys_file_depot 
 --hive-database  rcdn_stg 
 --hive-table stg_rcdn_sys_file_depot 
 --fields-terminated-by '|' 
 --hive-delims-replacement "" 
 -m 1

2、分区表

sqoop import 
 --connect 'jdbc:mysql://node03:3306/rc?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8&tinyInt1isBit=false&CatalogOptions=0;NumberPrecisionScale=1' 
 --username root 
 --password 'Changxin*8' 
 --query "select *  from zc_HBRMZCGW where 1=1  and $CONDITIONS " 
 --map-column-hive content=String 
 --hive-import  
 --as-textfile 
 --null-string '\N' 
 --null-non-string '\N' 
 --hive-overwrite   
 --delete-target-dir  
 --target-dir /user/hive/warehouse/rcdn_stg/stg_rcdn_zc_hbrmzcgw 
 --hive-database  rcdn_stg 
 --hive-table stg_rcdn_zc_hbrmzcgw 
 --fields-terminated-by '|' 
 --hive-delims-replacement "" 
 --hive-partition-key batch_no 
 --hive-partition-value 20211226 
 -m 1

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/735106.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号