sqoop自由形式查询导致hue/oozie中无法识别的参数

ttygqcqt  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(583)

我正在尝试使用自由形式查询运行sqoop命令,因为我需要执行聚合。它是通过hue界面提交的,作为一个oozie工作流。以下是命令和查询的缩小版本。处理命令时,“--query”语句(括在引号中)会导致查询的每个部分被解释为无法识别的参数,如命令后面的错误所示。此外,目标目录被曲解。是什么阻止了它的运行,可以做些什么来解决它?${env}和${shard}变量正在被正确解析,如上一条错误消息所反映的那样。
谢谢您!

导入--连接jdbc:mysql用法://irbasedw-${shard}.db.x。net:3417/irbasedw_${shard}?donttrackopenresources=true&defaultfetchsize=10000&usecursorfetch=true--用户名iretl--密码文件/irdw/${env}/lib/.passwordbasedw--表agg\u daily\u activity\u performance\u stage-m1--查询“从agg\u daily\u activity\u performance\u stage选择总和(单击计数)”其中$conditions group by 1“--target dir/irdw/${env}/legacy/agg/activity\u performance/text/shard${shard}

3881 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Error parsing arguments for import:
3881 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: SUM(click_count)
3881 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: FROM
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: agg_daily_activity_performance_stage
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: WHERE
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: \$CONDITIONS
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: GROUP
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: BY
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: 1"
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: --target-dir
3882 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool  - Unrecognized argument: /irdw/test/legacy/agg/activity_performance/text/shard_0
wgx48brx

wgx48brx1#

我能让它工作。解决方案是将所有查询元素作为单独的参数提交。“命令”窗口中不应有任何内容。相反,从“import”作为第一个参数开始,将查询的每个部分作为单独的参数输入。每个元素的属性和值都作为单独的参数输入。例如:

arg:  import
arg:  --connect
arg:  jdbc:mysql....
arg:  --username
arg:  [username]
arg:  --password-file
arg:  [password file]
arg:  --query
arg:  select .....
arg:  --target-dir
arg:  [target]

工作流按预期执行。

相关问题