Method: Fog::AWS::EMR::Real#run_hive

Defined in:
lib/fog/aws/requests/emr/run_job_flow.rb

#run_hive(name, options = {}) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/fog/aws/requests/emr/run_job_flow.rb', line 71

def run_hive(name, options={})
  steps = []
  steps << {
    'Name' => 'Setup Hive',
    'HadoopJarStep' => {
      'Jar' => 's3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar',
      'Args' => ['s3://us-east-1.elasticmapreduce/libs/hive/hive-script', '--base-path', 's3://us-east-1.elasticmapreduce/libs/hive/', '--install-hive']},
    'ActionOnFailure' => 'TERMINATE_JOB_FLOW'
  }
  
  # To add a configuration step to the Hive flow, see the step below
  # steps << {
  #   'Name' => 'Install Hive Site Configuration',
  #   'HadoopJarStep' => {
  #     'Jar' => 's3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar',
  #     'Args' => ['s3://us-east-1.elasticmapreduce/libs/hive/hive-script', '--base-path',  's3://us-east-1.elasticmapreduce/libs/hive/', '--install-hive-site', '--hive-site=s3://my.bucket/hive/hive-site.xml']},
  #   'ActionOnFailure' => 'TERMINATE_JOB_FLOW'
  # }
  options['Steps'] = steps
  
  if not options['Instances'].nil?
    options['Instances']['KeepJobFlowAliveWhenNoSteps'] = true
  end
  
  run_job_flow name, options
end