Class: Trino::Client::ModelVersions::V351::StatsAndCosts=Base.new(:stats,:costs)

Inherits:
Object
  • Object
show all
Defined in:
lib/trino/client/model_versions/351.rb

Class Method Summary collapse

Class Method Details

.decode(hash) ⇒ Object



2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
# File 'lib/trino/client/model_versions/351.rb', line 2280

def decode(hash)
  unless hash.is_a?(Hash)
    raise TypeError, "Can't convert #{hash.class} to Hash"
  end
  obj = allocate
  obj.send(:initialize_struct,
    hash["stats"] && Hash[hash["stats"].to_a.map! {|k,v| [k, PlanNodeStatsEstimate.decode(v)] }],
    hash["costs"] && Hash[hash["costs"].to_a.map! {|k,v| [k, PlanCostEstimate.decode(v)] }],
  )
  obj
end