sqoop:mysql to hdfs
2024-10-14 15:41:22
将mysql联合查询的结果导入到hdfs上
sqoop import --connect jdbc:mysql://ip/数据库 --username root --password 密码 --query "select p.bidNo as bidNo,p.interestTime as interestTime,p.status as status,p.planStatus as planStatus,
i.yield as yield,
i.startDate as startDate,
i.endDate as endDate,
i.cycle as cycle,
i.financedAmount as financedAmount,
e.interestType as interestType,
a.penaltyAmount as penaltyAmount,
(
case
when
(select count(1) from zx_standard_plan pp where pp.interestTime < p.interestTime and pp.bidNo = p.bidNo order by pp.interestTime desc limit 1) > 0
then (select TO_DAYS(date(from_unixtime(p.interestTime)))-TO_DAYS(date(from_unixtime((select pp.interestTime from zx_standard_plan pp where pp.interestTime < p.interestTime and pp.bidNo = p.bidNo order by pp.interestTime desc limit 1)))))
else (select TO_DAYS(date(from_unixtime(p.interestTime)))-TO_DAYS(date(from_unixtime(i.startDate))))
end) as days
from
zx_standard_plan p
left join zx_standard_informations i
on p.bidNo = i.bidNo
left join zx_standard_extra e
on e.bidNo = p.bidNo
left join zx_advance_repay a
on a.bidNo = p.bidNo
where
p.planStatus <> 'VOID' and
i.bidType <> 'GREEN' and
i.bidStatus <> 'FINISHED' and
\$CONDITIONS
order by p.interestTime asc" -m 1 --target-dir /zhongxin/standardPlanStatistics
最新文章
- ASP.NET Aries 4.0 开源发布:已完成基础功能优化重写
- sqlplus连接oracle失败分析和解决
- Spring Boot 框架@Temporal(TemporalType.DATE)
- PO、VO、BO、DTO、POJO、DAO
- MonoDevelop编辑器中文乱码解决
- 利用WebService发布图片文件
- PyDev-Python的Eclipse插件安装
- 【python】 web开发入门
- PhpStorm 4.0 &; 5.0 部署本地Web应用
- Extjs 4.2 右键菜单树节点(,选择逆,废除)
- 《算法导论》习题2.3-7 查找集合S中是否有两个元素和为X---Java实现
- Problem 2144 Shooting Game fzu
- 在IDEA中实战Git(转载自)
- 解决使用微软模拟器VS Emulator for Android在VS2017 Xamarin开发中不能调试程序的问题。
- Java字节码里的invoke操作&;&;编译时的静态绑定与动态绑定
- Python根据多个空格Split字符串
- C++.构造函数(超出范围)_01
- Django之WSGI 和MVC/MTV
- synchronized细节问题(一)
- JQuery 常用知识