Sha256: 14ac1b481ae4d2c7c3930be955687ef6532b4019616f7fdf3769756ea3ce746f
Contents?: true
Size: 530 Bytes
Versions: 19
Compression:
Stored size: 530 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'wukong' require 'wukong/streamer/summing_reducer' # # class Summer < Wukong::Streamer::SummingReducer attr_accessor :sample_line def initialize *args self.summing_elements = [0] super *args end def start! *args self.sample_line = args super *args end def get_key *fields fields.values_at(2,3) end def finalize summing_elements.each{|idx| sample_line[idx] = sums[idx]} yield sample_line end end Wukong::Script.new(Summer, nil).run
Version data entries
19 entries across 19 versions & 2 rubygems