例如这一层可能包含的数据表为:人口表(包含每个人的身份证号、姓名、住址等)、机场登机记录(包含乘机人身份证号、航班号、乘机日期、起飞城市等)、银联的刷卡信息表(包含银行卡号、刷卡地点、刷卡时间、刷卡金额等)、银行账户表(包含银行卡号、持卡人身份证号等)等等一系列原始的业务数据。这里我们可以看到,这一层面的数据还具有鲜明的业务数据库的特征,甚至还具有一定的关系数据库中的数据范式的组织形式。
sqoop import
--append
--connect $CONNECTURL
--username $ORACLENAME
--password $ORACLEPASSWORD
--target-dir $hdfsPath
--num-mappers 1 #使用1个mapper
--table $oralceTableName
--columns $columns
--fields-terminated-by '\001'
sqoop import
--append
--connect $CONNECTURL
--username $ORACLENAME
--password $ORACLEPASSWORD
--target-dir $hdfsPath
--num-mappers 4 #使用4个mapper
--table $oralceTableName
--columns $columns
--fields-terminated-by '\001'
--where "data_desc='2011-02-26'"
--查询主键的极值
select max(id) as max, select min(id) as min from table [where 如果指定了where子句];
--按照极值确定各自的处理范围
select * from table where 0 <= id < 250;
select * from table where 250 <= id < 500;
select * from table where 500 <= id < 750;
select * from table where 750 <= id < 1000;
sqoop import
sqoop import
--append
--connect $CONNECTURL
--username $ORACLENAME
--password $ORACLEPASSWORD
--target-dir $hdfsPath
--num-mappers 4 #使用4个mapper
--table $oralceTableName
--columns $columns
--fields-terminated-by '\001'
--incremental append #增量数据
--check-column num_iid #检查列
--last-value 0 #最后的值
sqoop import
--append
--connect $CONNECTURL
--username $ORACLENAME
--password $ORACLEPASSWORD
--target-dir $hdfsPath
--num-mappers 4 #使用4个mapper
--table $oralceTableName
--columns $columns
--fields-terminated-by '\001'
--incremental lastmodified #
--check-column created #
--last-value '2012-02-01 11:0:00'
欢迎光临 168大数据 (http://www.bi168.cn/) | Powered by Discuz! X3.2 |