6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/rbpig.rb', line 6
def executable(configs)
configs = pig_configs(configs)
pig_options = ["-Dudf.import.list=forward.pig.storage"]
unless configs[:hadoop_config].nil?
hadoop_config = {}
REXML::Document.new(File.new(configs[:hadoop_config])).elements.each('configuration/property') do |property|
hadoop_config[property.elements[1].text] = property.elements[2].text
end
pig_options << "-Dfs.default.name=#{hadoop_config["fs.default.name"]}" if hadoop_config.has_key?("fs.default.name")
pig_options << "-Dmapred.job.tracker=#{hadoop_config["mapred.job.tracker"]}" if hadoop_config.has_key?("mapred.job.tracker")
end
["PIG_CLASSPATH='#{pig_classpath(configs)}'", "PIG_OPTS='#{pig_options.join(" ")}'", "pig", "-l /tmp"].join(" ")
end
|