class Sequel::Impala::Dataset

Constants

APOS
STRING_ESCAPES
STRING_ESCAPE_RE

Public Instance Methods

fetch_rows(sql) { |row| ... } click to toggle source
    # File lib/sequel/adapters/impala.rb
190 def fetch_rows(sql)
191   execute(sql, @opts) do |cursor|
192     self.columns = cursor.columns.map!{|c| output_identifier(c)}
193     cursor.typecast_map['timestamp'] = db.method(:to_application_timestamp)
194     cursor.each do |row|
195       yield row
196     end
197   end
198 
199   self
200 end
profile(profile_name=:default) click to toggle source
    # File lib/sequel/adapters/impala.rb
202 def profile(profile_name=:default)
203   clone(:profile_name => profile_name)
204 end
query_id(query_id_name=:default) click to toggle source
    # File lib/sequel/adapters/impala.rb
206 def query_id(query_id_name=:default)
207   clone(:query_id_name => query_id_name)
208 end

Private Instance Methods

literal_string_append(sql, s) click to toggle source

Unlike the jdbc/hive2 driver, the impala driver requires you escape some values in string literals to get correct results, but not the tab character or things break.

    # File lib/sequel/adapters/impala.rb
215 def literal_string_append(sql, s)
216   sql << APOS << s.to_s.gsub(STRING_ESCAPE_RE){|m| STRING_ESCAPES[m]} << APOS
217 end