使用sqoop从sqlserver导出数据的时候无法替换其中的特殊字符
0
使用下面的语句导出数据:
sqoop import --connect "jdbc:sqlserver://xxxx.xxxx.xxxx.xxxx;username=xxx; password=xxx;database=xxxx" --query "select GoodsCode,GoodsNo,GoodsName,ProdArea from hq.[000].tbgoods where \$CONDITIONS" -m 1 --target-dir /user/hive/warehouse/tmp/tbgoods --as-textfile --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t' --lines-terminated-by '\n' --hive-drop-import-delims --delete-target-dir
然而,表中的字段中含有一些 ‘\t’ ,但是使用这个命令并没有能够删掉其中的 ’\t‘ ,使用--hive-delims-replacement 'x' 也无法替换,请问大家有没有什么其他的办法?
sqoop import --connect "jdbc:sqlserver://xxxx.xxxx.xxxx.xxxx;username=xxx; password=xxx;database=xxxx" --query "select GoodsCode,GoodsNo,GoodsName,ProdArea from hq.[000].tbgoods where \$CONDITIONS" -m 1 --target-dir /user/hive/warehouse/tmp/tbgoods --as-textfile --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t' --lines-terminated-by '\n' --hive-drop-import-delims --delete-target-dir
然而,表中的字段中含有一些 ‘\t’ ,但是使用这个命令并没有能够删掉其中的 ’\t‘ ,使用--hive-delims-replacement 'x' 也无法替换,请问大家有没有什么其他的办法?
没有找到相关结果
重要提示:提问者不能发表回复,可以通过评论与回答者沟通,沟通后可以通过编辑功能完善问题描述,以便后续其他人能够更容易理解问题.
1 个回复
Bob - 同程旅游大数据+BI 架构师 2016-02-14 回答
赞同来自: