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
162 def fetch_rows(sql)
163   execute(sql, @opts) do |cursor|
164     @columns = cursor.columns.map!{|c| output_identifier(c)}
165     cursor.typecast_map['timestamp'] = db.method(:to_application_timestamp)
166     cursor.each do |row|
167       yield row
168     end
169   end
170 
171   self
172 end
profile(profile_name=:default) click to toggle source
    # File lib/sequel/adapters/impala.rb
174 def profile(profile_name=:default)
175   clone(:profile_name => profile_name)
176 end
query_id(query_id_name=:default) click to toggle source
    # File lib/sequel/adapters/impala.rb
178 def query_id(query_id_name=:default)
179   clone(:query_id_name => query_id_name)
180 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
187 def literal_string_append(sql, s)
188   sql << APOS << s.to_s.gsub(STRING_ESCAPE_RE){|m| STRING_ESCAPES[m]} << APOS
189 end