当我从终端运行 sqoop export 时,它正常运行。但是从python脚本执行它会返回错误:
*ERROR tool.BaseSqoopTool: Unrecognized argument: --connect
ERROR tool.BaseSqoopTool: Unrecognized argument: --table
ERROR tool.BaseSqoopTool: Unrecognized argument: --export_dir*
以下是代码段:
call(["/usr/local/sqoop/bin/sqoop","export","--connect jdbc:mysql://localhost/temp","--table table1" ,"--export-dir /user/data/input" ,"--username root"])
假设导入了子进程模块
答案 0 :(得分:1)
参数列表中的单个参数不应包含任何空格。该行应如下所示:
call(["/usr/local/sqoop/bin/sqoop","export","--connect", "jdbc:mysql://localhost/temp","--table", "table1" ,"--export-dir", "/user/data/input" ,"--username", "root"])