module Trino::Client::ModelVersions::V0_205::StageInfo

Public Class Methods

decode(hash) click to toggle source
# File lib/trino/client/model_versions/0.205.rb, line 1720
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["stageId"] && StageId.new(hash["stageId"]),
    hash["state"] && hash["state"].downcase.to_sym,
    hash["self"],
    hash["plan"] && PlanFragment.decode(hash["plan"]),
    hash["types"],
    hash["stageStats"] && StageStats.decode(hash["stageStats"]),
    hash["tasks"] && hash["tasks"].map {|h| TaskInfo.decode(h) },
    hash["subStages"] && hash["subStages"].map {|h| StageInfo.decode(h) },
    hash["failureCause"] && ExecutionFailureInfo.decode(hash["failureCause"]),
  )
  obj
end