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

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

Class Method Summary collapse

Class Method Details

.decode(hash) ⇒ Object



2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
# File 'lib/trino/client/model_versions/303.rb', line 2134

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, PlanNodeCostEstimate.decode(v)] }],
  )
  obj
end