我正在sqoop
从Oozie
工作流中执行工作。我可以在sqoop
命令中创建具有静态名称的目标目录,如下所示。
<action name="table1" cred="">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<command>job --exec EMPLOYEE --meta-connect jdbc:hsqldb:hsql://<host>:<port>/sqoop -- --target-dir /user/test/Employee/20150126</command>
</sqoop>
<ok to="end" />
<error to="kill" />
</action>
我需要创建带有日期的动态目标目录。我尝试了以下,但没有工作。
<action name="table1" cred="">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<command>job --exec EMPLOYEE --meta-connect jdbc:hsqldb:hsql://<host>:<port>/sqoop -- --target-dir /user/test/Employee/$(date +%Y%m%d)</command>
</sqoop>
<ok to="end" />
<error to="kill" />
</action>
运行时显示以下错误。
3622 [main] INFO org.apache.sqoop.Sqoop - Running Sqoop version: 1.4.5-cdh5.2.0
3957 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Error parsing arguments for import:
3957 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: +%Y%m%d)
Intercepting System.exit(1)