sqoop抽取数据从oracle到hive的示例以及一些问题的解决方法

sqoop import -Dorg.apache.sqoop.splitter.allow_text_splitter=true \
--connect jdbc:oracle:thin:@10.253.253.111:1521/testdb \
--username nc65test8 \
--password nc65test8 \
--table FA_USINGSTATUS \
--hive-import \
--hive-table ods.fa_usingstatus \
--delete-target-dir \
--as-textfile \
--hive-drop-import-delims \
--fields-terminated-by '\001' \
--null-string '\\N' \
--null-non-string '\\N' \
--hive-overwrite \
--m 1

-Dorg.apache.sqoop.splitter.allow_text_splitter=true 切分键不为数字时需要加这个参数

–hive-drop-import-delims 字段中有’\n’时需要加这个参数,不然在hdfs文件映射为hive表时’\n’会被当做换行符,导致数据出问题.

猜你喜欢

转载自blog.csdn.net/JAVA_LuZiMaKei/article/details/118941156