gpt4 book ai didi

sql-server - Sqoop导出到SQL Server-无法解析字符串值(NTL-NATIONAL)

转载 作者:行者123 更新时间:2023-12-02 21:14:21 32 4
gpt4 key购买 nike

我试图通过使用Sqoop将Hive表导出到SQL Server。我在 hive 表中有一个字符串字段,SQL Server中此字段的格式为varchar(255)。在运行以下Sqoop导出时:

sqoop export -Dmapreduce.job.queuename=default
--connect 'jdbc:sqlserver://IPaddress:portnumber;databasename=mydbname'
--username xxx
--password xxx
--table tablename
--export-dir /hive_directory/tablename
--columns all_my_columns
--input-fields-terminated-by '^'
--input-null-string "\\\\N" --input-null-non-string "\\\\N"

我得到以下错误。字段值类似于…NTL-NATIONAL。赞赏有任何想法来解析此值。谢谢。
INFO mapreduce.Job: Task Id : attempt_1468858380028_769962_m_000002_0, Status : FAILED
Error: java.io.IOException: Can't export data, please check failed map task logs
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:112)
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:39)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162)
Caused by: java.lang.RuntimeException: Can't parse input data: 'NTL-NATIONAL'
at test_fnl.__loadFromFields(test_fnl.java:1109)
at test_fnl.parse(test_fnl.java:952)
at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:83)
... 10 more
Caused by: java.util.NoSuchElementException
at java.util.ArrayList$Itr.next(ArrayList.java:854)
at test_fnl.__loadFromFields(test_fnl.java:1104)
... 12 more

最佳答案

您是否尝试过包含此论点?

--input-lines-terminated-by <char>


--input-lines-terminated-by '\n'

关于sql-server - Sqoop导出到SQL Server-无法解析字符串值(NTL-NATIONAL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39263599/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com