运行 sqoop 使用 python 子进程无法识别参数

Running sqoop using python subprocess can't recognize the arguments

当我 运行 sqoop export 从终端 运行s properly.But 从 python 脚本执行它 returns错误:

*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"])

假设导入了子流程模块

参数列表中的单个参数不应包含任何空格。该行应如下所示:

call(["/usr/local/sqoop/bin/sqoop","export","--connect", "jdbc:mysql://localhost/temp","--table", "table1" ,"--export-dir", "/user/data/input" ,"--username", "root"])