sqooooop命令总结:

来源:互联网 发布:linux lcd驱动移植 编辑:程序博客网 时间:2024/06/04 19:23
sqoop import --append \
--connect jdbc:oracle:thin:@$ip:$port:$sid \
--username $userName \
--password$ password \
--table `echo "$tableName" | tr a-z A-Z` \
--where "create_time >= to_date('2014-07-24','yyyy-mm-dd') and create_time < to_date('2014-07-25','yyyy-mm-dd')" \
--fields-terminated-by '\t' \
--target-dir /user/hive/$userName.db/$tableName/part=20140724/ \
--m 1



sqoop export --connect jdbc:oracle:thin:@$ip:$port:$sid -username $userName -password $password --table $tableName --export-dir /user/hive/warehouse/result.db/$tableName/ --input-fields-terminated-by '\t'
oracle的表名称必须大写,hive的表的hdfs路径文件名必须小写。
原创粉丝点击