Class: Presto::Client::QueryResults

Inherits:
Object
  • Object
show all
Defined in:
lib/presto/client/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ QueryResults

Returns a new instance of QueryResults.



169
170
171
172
173
174
175
176
177
178
# File 'lib/presto/client/models.rb', line 169

def initialize(options={})
  @id = options[:id]
  @info_uri = options[:info_uri]
  @partial_cache_uri = options[:partial_cache_uri]
  @next_uri = options[:next_uri]
  @columns = options[:columns]
  @data = options[:data]
  @stats = options[:stats]
  @error = options[:error]
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



164
165
166
# File 'lib/presto/client/models.rb', line 164

def columns
  @columns
end

#dataObject (readonly)

Returns the value of attribute data.



165
166
167
# File 'lib/presto/client/models.rb', line 165

def data
  @data
end

#errorObject (readonly)

Returns the value of attribute error.



167
168
169
# File 'lib/presto/client/models.rb', line 167

def error
  @error
end

#idObject (readonly)

Returns the value of attribute id.



160
161
162
# File 'lib/presto/client/models.rb', line 160

def id
  @id
end

#info_uriObject (readonly)

Returns the value of attribute info_uri.



161
162
163
# File 'lib/presto/client/models.rb', line 161

def info_uri
  @info_uri
end

#next_uriObject (readonly)

Returns the value of attribute next_uri.



163
164
165
# File 'lib/presto/client/models.rb', line 163

def next_uri
  @next_uri
end

#partial_cache_uriObject (readonly)

Returns the value of attribute partial_cache_uri.



162
163
164
# File 'lib/presto/client/models.rb', line 162

def partial_cache_uri
  @partial_cache_uri
end

#statsObject (readonly)

Returns the value of attribute stats.



166
167
168
# File 'lib/presto/client/models.rb', line 166

def stats
  @stats
end

Class Method Details

.decode_hash(hash) ⇒ Object



180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/presto/client/models.rb', line 180

def self.decode_hash(hash)
  new(
    id: hash["id"],
    info_uri: hash["infoUri"],
    partial_cache_uri: hash["partialCancelUri"],
    next_uri: hash["nextUri"],
    columns: hash["columns"] ? hash["columns"].map {|h| Column.decode_hash(h) } : nil,
    data: hash["data"],
    stats: StatementStats.decode_hash(hash["stats"]),
    error: hash["error"],  # TODO
  )
end