Class: HadoopDsl::HiveLike::HiveLikeMapperModel

Inherits:
BaseMapperModel show all
Defined in:
lib/hive_like.rb

Overview

model

Defined Under Namespace

Classes: Table

Instance Attribute Summary collapse

Attributes inherited from BaseMapperModel

#key, #value

Attributes inherited from BaseModel

#controller

Instance Method Summary collapse

Methods inherited from BaseMapperModel

#initialize

Methods included from DslElement

#method_missing

Constructor Details

This class inherits a constructor from HadoopDsl::BaseMapperModel

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HadoopDsl::DslElement

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



82
83
84
# File 'lib/hive_like.rb', line 82

def table
  @table
end

Instance Method Details

#create_table(name, *column_and_type) ⇒ Object



84
85
86
87
88
89
90
# File 'lib/hive_like.rb', line 84

def create_table(name, *column_and_type)
  @table = Table.new(name)
  column_and_type.each_with_index do |column, index|
    next if index % 2 != 0 # type
    @table.columns << column_and_type[index]
  end
end