sh sqoop-incremental-load.sh
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh sqoop-incremental-load.sh相关的知识,希望对你有一定的参考价值。
# Baseline import
sqoop import \
--connect jdbc:mysql://ms.itversity.com:3306/retail_db \
--username retail_user \
--password itversity \
--target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
--num-mappers 2 \
--query "select * from orders where \$CONDITIONS and order_date like '2013-%'" \
--split-by order_id
# Query can be used to load data based on condition
sqoop import \
--connect jdbc:mysql://ms.itversity.com:3306/retail_db \
--username retail_user \
--password itversity \
--target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
--num-mappers 2 \
--query "select * from orders where \$CONDITIONS and order_date like '2014-01%'" \
--split-by order_id \
--append
# where in conjunction with table can be used to get data based up on a condition
sqoop import \
--connect jdbc:mysql://ms.itversity.com:3306/retail_db \
--username retail_user \
--password itversity \
--target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
--num-mappers 2 \
--table orders \
--where "order_date like '2014-02%'" \
--append
# Incremental load using arguments specific to incremental load
sqoop import \
--connect jdbc:mysql://ms.itversity.com:3306/retail_db \
--username retail_user \
--password itversity \
--target-dir /user/dgadiraju/sqoop_import/retail_db/orders \
--num-mappers 2 \
--table orders \
--check-column order_date \
--incremental append \
--last-value '2014-02-28'
以上是关于sh sqoop-incremental-load.sh的主要内容,如果未能解决你的问题,请参考以下文章
如何使我的命令行在具有扩展名(.sh)和名称如“weird.sh.sh.sh”的文件上工作
sh sh_template.sh
sh sh.sh
Linux下面如何运行 SH文件
配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh
shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别