Class: Hog::PigSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/hog/pig_schema.rb

Direct Known Subclasses

HiveSchema

Instance Method Summary collapse

Instance Method Details

#field(f) ⇒ Object



7
8
9
# File 'lib/hog/pig_schema.rb', line 7

def field(f)
  "#{f.name}:#{f.type}"
end

#schema(tuple) ⇒ Object



3
4
5
# File 'lib/hog/pig_schema.rb', line 3

def schema(tuple)
  "\n--\n-- This schema was auto generated by Hog v#{Hog::VERSION}.\n--\n-- #{f.opts.to_s}\n#{tuple.fields.map{|f| "\t#{field(f)}" }.join(",\n")}"
end