sqoop 初用
2015-10-29 14:31
295 查看
http://blog.csdn.net/dbanote/article/details/8907650
目前版本的Sqoop中,使用自由形式查询导入,只提供简单的查询,没有复杂的和“OR”条件查询在where子句中。
http://blog.csdn.net/niityzu/article/details/42835273
sqoop list-databases --connect jdbc:mysql://ip:3306/ --username * --password *
sqoop import --connect jdbc:mysql://ip:3306/gwr --username * --password * --table * -m 1
sqoop import --connect jdbc:mysql://ip:3306/gwr --username * --password g* --split-by Period -e 'select s.*, a.UtilityAccountID from AccountStats s, Account a where a.AccountID=s.AccountID and $CONDITIONS' --target-dir /data -m 2
m 表示mapreduce进程数
Afilter = FILTER A by (StatsType MATCHES '.*EON_SH.heatinghours.*' or StatsType MATCHES '.*....*');
从hdfs导出到数据库
sqoop export --connect jdbc:mysql://ip:3306/gwr --username * --password g* --table AccountStatsAggregate --fields-terminated-by '\t' --export-dir '/user/hduser/heatinghours'
要保证路径里的文本格式和数据库设定的一致才能导入
export 到MySQL中,增量覆盖:
http://hadooped.blogspot.sg/2013/06/apache-sqoop-part-3-data-transfer.html
目前版本的Sqoop中,使用自由形式查询导入,只提供简单的查询,没有复杂的和“OR”条件查询在where子句中。
http://blog.csdn.net/niityzu/article/details/42835273
sqoop list-databases --connect jdbc:mysql://ip:3306/ --username * --password *
sqoop import --connect jdbc:mysql://ip:3306/gwr --username * --password * --table * -m 1
sqoop import --connect jdbc:mysql://ip:3306/gwr --username * --password g* --split-by Period -e 'select s.*, a.UtilityAccountID from AccountStats s, Account a where a.AccountID=s.AccountID and $CONDITIONS' --target-dir /data -m 2
m 表示mapreduce进程数
Afilter = FILTER A by (StatsType MATCHES '.*EON_SH.heatinghours.*' or StatsType MATCHES '.*....*');
从hdfs导出到数据库
sqoop export --connect jdbc:mysql://ip:3306/gwr --username * --password g* --table AccountStatsAggregate --fields-terminated-by '\t' --export-dir '/user/hduser/heatinghours'
要保证路径里的文本格式和数据库设定的一致才能导入
export 到MySQL中,增量覆盖:
http://hadooped.blogspot.sg/2013/06/apache-sqoop-part-3-data-transfer.html
相关文章推荐
- Maven搭建hadoop环境之pom.xml基本配置
- 【高招职位精选】大咖公司诚邀运维工程师,一起发现运维之美
- linux下搭建discuz
- Linux基本命令
- nginx配置详解
- linux服务器和windows服务器中svn服务器的搭建【仅供参考】
- LinuxShell算术运算
- [Linux] grep命令笔记
- 第二部分 linux 文件,目录,磁盘格式
- Java Web开发的轻便架构Tapestry5---简介
- linux 里的`反引号
- Linux基础一cd 与 ls 命令详解
- PopupWindow源码分析
- Tomcat内存溢出的三种情况及解决办法分析
- 利用ssrf 掩盖自己的ip地址,从而攻击其他网站
- apache kafka监控系列-KafkaOffsetMonitor
- linux shell中28个特殊字符的作用
- nginx配置详解-url重写、反向代理、负载均衡
- Apache Kafka监控之Kafka Web Console
- CentOS-6.3安装配置JDK-7或 JDK-6