module Trino::Client::ModelVersions::V316::QueryInfo
Public Class Methods
decode(hash)
click to toggle source
# File lib/trino/client/model_versions/316.rb, line 1599 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["queryId"], hash["session"] && SessionRepresentation.decode(hash["session"]), hash["state"] && hash["state"].downcase.to_sym, hash["memoryPool"], hash["scheduled"], hash["self"], hash["fieldNames"], hash["query"], hash["preparedQuery"], hash["queryStats"] && QueryStats.decode(hash["queryStats"]), hash["setCatalog"], hash["setSchema"], hash["setPath"], hash["setSessionProperties"], hash["resetSessionProperties"], hash["setRoles"] && Hash[hash["setRoles"].to_a.map! {|k,v| [k, SelectedRole.decode(v)] }], hash["addedPreparedStatements"], hash["deallocatedPreparedStatements"], hash["startedTransactionId"], hash["clearTransactionId"], hash["updateType"], hash["outputStage"] && StageInfo.decode(hash["outputStage"]), hash["failureInfo"] && ExecutionFailureInfo.decode(hash["failureInfo"]), hash["errorCode"] && ErrorCode.decode(hash["errorCode"]), hash["warnings"] && hash["warnings"].map {|h| PrestoWarning.decode(h) }, hash["inputs"] && hash["inputs"].map {|h| Input.decode(h) }, hash["output"] && Output.decode(hash["output"]), hash["completeInfo"], hash["resourceGroupId"] && ResourceGroupId.new(hash["resourceGroupId"]), hash["finalQueryInfo"], ) obj end