Class: Sequel::Hive::Dataset

Inherits:
Dataset
  • Object
show all
Defined in:
lib/sequel/adapters/hive.rb

Constant Summary collapse

SELECT_CLAUSE_METHODS =
clause_methods(:select, %w'distinct columns from join where group having compounds order limit')

Instance Method Summary collapse

Instance Method Details

#columnsObject



62
63
64
# File 'lib/sequel/adapters/hive.rb', line 62

def columns
  @columns ||= schema.map{|c| c.first.to_sym}
end

#fetch_rows(sql) ⇒ Object



66
67
68
69
70
71
72
73
# File 'lib/sequel/adapters/hive.rb', line 66

def fetch_rows(sql)
  execute(sql) do |result|
    result.each do |r|
      yield r
    end
  end
  self
end

#schemaObject



58
59
60
# File 'lib/sequel/adapters/hive.rb', line 58

def schema
  @schema ||= @db.schema(@opts[:from].first)
end