Sqoop informix导入hive

Query语句查询

#!/bin/bash
sql=“select * from tablename”
/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/lib/sqoop/bin/sqoop import
–connect “jdbc:informix-sqli://IP:PORT/databaseName:INFORMIXSERVER=p550s2_on;ifx_use_strenc=true;NEWLOCAL=zh_cn,en_us;NEWCODESET=gbk,8859-1,819;IFX_USE_SIRENC=true;user=xxx;password=xxx”
–driver com.informix.jdbc.IfxDriver
–fields-terminated-by “\t”
–hive-drop-import-delims
–target-dir /warehouse/hive/test/car_insured
–lines-terminated-by “\n”
–hive-import --hive-overwrite --create-hive-table
–input-null-non-string ‘0’ --input-null-string ‘’
–hive-table picc.car_insured --null-string ‘\N’ --null-non-string ‘\N’
–query ‘$sql’ and $CONDITIONS’
-m 1

并行导入hive

#!/bin/bash
/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/lib/sqoop/bin/sqoop import
–connect “jdbc:informix-sqli://ip:port/databaseName:INFORMIXSERVER=p550s2_on;ifx_use_strenc=true;NEWLOCAL=zh_cn,en_us;NEWCODESET=gbk,8859-1,819;IFX_USE_SIRENC=true;user=xxx;password=xxx”
–driver com.informix.jdbc.IfxDriver
–table tablename
–fields-terminated-by “\t”
–hive-drop-import-delims
–lines-terminated-by “\n” --hive-import --hive-overwrite --create-hive-table
–input-null-non-string ‘0’ --input-null-string ‘’
–hive-table picc.customermain --null-string ‘\N’ --null-non-string ‘\N’
–split-by ‘filed’
-m 3

where语句导入

/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/lib/sqoop/bin/sqoop import
–connect “jdbc:informix-sqli://ip:port/databaseName:INFORMIXSERVER=p550s2_on;ifx_use_strenc=true;NEWLOCAL=zh_cn,en_us;NEWCODESET=gbk,8859-1,819;IFX_USE_SIRENC=true;user=xxx;password=xxx”
–driver com.informix.jdbc.IfxDriver
–table tablename
–fields-terminated-by “\t”
–hive-drop-import-delims
–lines-terminated-by “\n” --hive-import --hive-overwrite --create-hive-table
–input-null-non-string ‘0’ --input-null-string ‘’
–hive-table picc.customerpho_final_temp --null-string ‘\N’ --null-non-string ‘\N’
–split-by ‘field’
–where ‘id>=1’
-m 6

Informix 导入到Hbase

#!/bin/bash
/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/lib/sqoop/bin/sqoop import
–connect “jdbc:informix-sqli://ip:port/databaseName:INFORMIXSERVER=p550s2_on;ifx_use_strenc=true;NEWLOCAL=zh_cn,en_us;NEWCODESET=gbk,8859-1,819;IFX_USE_SIRENC=true;user=xxx;password=xxxx”
–driver com.informix.jdbc.IfxDriver
–table ‘tablename’ --hbase-table ‘hbaseTable’ --hbase-row-key ‘rowkey’ --column-family ‘info’
-m 1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值