gpt4 book ai didi

mysql - 在hadoop上使用sqoop import命令时出现错误

转载 作者:行者123 更新时间:2023-12-02 18:57:38 25 4
gpt4 key购买 nike

您好,我正在使用以下sqoop命令,我认为应该可以使用

[cloudera@quickstart ~]$ sqoop import --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username root --password cloudera --query "select * from customers where customer_street like '%Plaza%' AND $CONDITIONS" --target-dir /user/cloudera/problem1/customers/textdata --fields-terminated-by '*' --lines-terminated-by '|' --as-textfile --columns "customer_id,customer_fname,customer_lname,customer_street" --split-by "customer_id"

但是我得到以下与$ condition相关的错误,我认为该错误已正确实现..请帮助..谢谢

Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail. Please set $ACCUMULO_HOME to the root of your Accumulo installation. 19/11/17 10:12:10 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.13.0 19/11/17 10:12:10 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 19/11/17 10:12:10 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset. 19/11/17 10:12:10 INFO tool.CodeGenTool: Beginning code generation 19/11/17 10:12:10 ERROR tool.ImportTool: Import failed: java.io.IOException: Query [select * from customers where customer_street like '%Plaza%' AND ] must contain '$CONDITIONS' in WHERE clause. at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:332) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1858) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1657) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:106) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:494) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:621) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243) at org.apache.sqoop.Sqoop.main(Sqoop.java:252)

最佳答案

您好以下应该可以使用

 sqoop import --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username root --password cloudera --query "select * from customers where \$CONDITIONS AND customer_street like '%Plaza%'" --target-dir /user/cloudera/problem1/customers/textdata --fields-terminated-by '*' --lines-terminated-by '|' --as-textfile --columns "customer_id,customer_fname,customer_lname,customer_street" --split-by "customer_id"

关于mysql - 在hadoop上使用sqoop import命令时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58903669/

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