【问题标题】:Error in sqoop incremental import commandsqoop增量导入命令出错
【发布时间】:2017-03-08 16:25:22
【问题描述】:

我正在处理一个 sqoop 增量导入命令。但我最后收到错误消息,我不明白问题出在哪里。 下面是我的 MySQL 表数据

+----+-----------+
| ID | NAME      |
+----+-----------+
|  1 | Sidhartha |
|  2 | Sunny     |
|  3 | Saketh    |
|  4 | Bobby     |
|  5 | Yash      |
|  6 | Nimmi     |
+----+-----------+

具有 4 条记录的 Hive 表:DAY 是分区列

importedtable.id    importedtable.name  importedtable.day
1   Sidhartha   1
2   Sunny   1
3   Saketh  1
4   Bobby   1

我的 Sqoop 命令:

sqoop import --connect jdbc:mysql://127.0.0.1/mydb --table MYTAB --driver com.mysql.jdbc.Driver --username root --password cloudera --hive-import --hive-table importedtable --incremental append --check-column id --last-value $(hive -e "select max(id) from importedtable") --target-dir '/home/incdata';

错误信息:

17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Error parsing arguments for import:
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: WARN:
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: The
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: method
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: class
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: org.apache.commons.logging.impl.SLF4JLogFactory#release()
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: was
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: invoked.
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: WARN:
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: Please
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: see
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: http://www.slf4j.org/codes.html#release
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: for
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: an
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: explanation.
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: --target-dir
17/03/08 12:15:14 ERROR tool.BaseSqoopTool: Unrecognized argument: /home/incdata

谁能告诉我我执行 sqoop 命令的错误是什么。

【问题讨论】:

    标签: hadoop sqoop


    【解决方案1】:

    问题在于作为 --last-value 参数的值传递的配置单元查询,

    --last-value $(hive -e "select max(id) from importedtable")
    

    这会将日志消息连同结果一起发送到--last-value

    在查询中使用-S (--silent) 标志,

    --last-value $(hive -S -e "select max(id) from importedtable")
    

    【讨论】:

    • @frankin,在 --last-value 中使用“-S”仍然会出现同样的错误
    • 请检查更新后的答案,-S 是 hive 执行的一部分。
    • 执行了与您给出的相同的命令(更新的答案)。它仍然无法正常工作。 17/03/08 12:49:47 错误 tool.BaseSqoopTool:解析导入参数时出错:无法识别的参数:警告:调用了方法类 org.apache.commons.logging.impl.SLF4JLogFactory#release()。请参阅slf4j.org/codes.html#release 了解说明。
    • 这个日志警告是从 hive 发出的,应该被-S 标志抑制。您是否在终端中单独执行了 hive 语句?结果如何?
    • 是的,我做到了。这是您所要求的特定陈述的结果。 2017-03-08 12:55:11,550 WARN [main] mapreduce.TableMapReduceUtil:包含 PrefixTreeCodec 的 hbase-prefix-tree 模块 jar 不存在。继续没有它。 4 警告:调用了方法类 org.apache.commons.logging.impl.SLF4JLogFactory#release()。警告:请参阅slf4j.org/codes.html#release 以获得解释。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-27
    • 2015-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多