作为 Amazon AWS 数据管道的一部分,我有一个使用两个未暂存的 S3 数据节点作为输入的配置单元活动。我想要的是能够在活动上设置两个脚本变量,每个变量都指向一个输入数据节点,但我无法获得正确的语法。使用单个输入,我可以编写以下内容,并且可以正常工作:
INPUT_FOO=#{input.directoryPath}
当我添加第二个输入时,我遇到了如何引用它们的问题,因为它们现在是一个输入数组,正如您在下面的管道定义中看到的那样。本质上,我想实现以下目标,但无法找出正确的语法:
INPUT_FOO=#{input[1].directoryPath}
INPUT_BAR=#{input[2].directoryPath}
这是管道定义的活动部分:
{
"id": "ActivityId_7u1sR",
"input": [
{
"ref": "DataNodeId_iYnxf"
},
{
"ref": "DataNodeId_162Ka"
}
],
"schedule": {
"ref": "DefaultSchedule"
},
"scriptUri": "#{myS3ScriptLocation}calculate-results.q",
"name": "Perform Calculations",
"runsOn": {
"ref": "EmrClusterId_jHeiV"
},
"scriptVariable": [
"INPUT_SOURCE1=#{input[1].directoryPath}",
"OUTPUT=#{output.directoryPath}Results/",
"INPUT_SOURCE2=#{input[2].directoryPath}"
],
"output": {
"ref": "DataNodeId_2jY6v"
},
"type": "HiveActivity",
"stage": "false"
}
我计划不暂存表并在 hive 脚本中处理表创建,以便更容易单独运行每个 Hive 活动以及在管道本身中运行。
这是我在使用数组语法时看到的错误:
Unable to resolve input[1].directoryPath for object ActivityId_7u1sR'