daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %YAML 1.1
  2. ---
  3. VERSION:         1.0.0.1
  4.  
  5. DEFINE:
  6.   - INPUT:
  7.       NAME:      book
  8.       FILE:
  9.         # change seghostname and file_path to reflect your
  10.         # runtime file location
  11.         - localhost.localdomain:/home/gpadmin/gpmrdata/whitepaper.txt
  12.  
  13.   - MAP:
  14.       NAME:      wordsplit_ruby
  15.       FUNCTION:  |
  16.         h = {}
  17.         value.split.each { |w|
  18.           if h.has_key?(w)
  19.             h[w] = h[w] + 1
  20.           else
  21.             h[w] = 1
  22.          end
  23.         }
  24.         h.each_pair {|k,v| yield [k,v]}
  25.         return
  26.       LANGUAGE:   ruby
  27.       OPTIMIZE:   STRICT IMMUTABLE
  28.       PARAMETERS: value text
  29.       RETURNS:
  30.         - key text
  31.         - value integer
  32.  
  33. EXECUTE:
  34.   - RUN:
  35.       SOURCE:    book
  36.       MAP:       wordsplit_ruby
  37.       REDUCE:    SUM
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top