Orchestrate Sqoop with Step Functions

0

Can we use Step Functions to orchestrate a Sqoop job? The goal is to create a transient cluster which load data with Sqoop first followed by transformation in Hive, but looks like Command Runner does not have such option.

If not, what are the alternatives?

AWS
已提問 3 年前檢視次數 375 次
1 個回答
0
已接受的答案

You can run any script in script runner mode.

https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-hadoop-script.html

Basically from the step function invoke the syntax thats required by the script runner, for example:

       "StartAt":"Step 1",
       "States":{ 
          "Step_1":{ 
             "Type":"Task",
             "Resource":"arn:aws:states:::elasticmapreduce:addStep.sync",
             "Parameters":{ 
                "ClusterId.$":"$.ClusterId",
                "Step":{ 
                   "Name":"1 - Step 1",
                   "ActionOnFailure":"CONTINUE",
                   "HadoopJarStep":{ 
                      "Jar":"s3://elasticmapreduce/libs/script-runner/script-runner.jar",
                      "Args":[ 
                         "s3://xxx/scripts/step1.sh"
                      ]
                   }
                }
             },
             "End":true
          }
       }
    }

Put all the code in the step1.sh script, this script will execute on master node and do any task you want including your sqoop stuff

AWS
專家
Behram
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南