Module: Trino::Client::ModelVersions::V351::OperatorInfo

Defined in:
lib/trino/client/model_versions/351.rb

Overview

Inner classes

Class Method Summary collapse

Class Method Details

.decode(hash) ⇒ Object



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/trino/client/model_versions/351.rb', line 230

def self.decode(hash)
  unless hash.is_a?(Hash)
    raise TypeError, "Can't convert #{hash.class} to Hash"
  end
  model_class = case hash["@type"]
    when "exchangeClientStatus"   then ExchangeClientStatus
    when "localExchangeBuffer"    then LocalExchangeBufferInfo
    when "tableFinish"            then TableFinishInfo
    when "splitOperator"          then SplitOperatorInfo
    when "hashCollisionsInfo"     then HashCollisionsInfo
    when "partitionedOutput"      then PartitionedOutputInfo
    when "joinOperatorInfo"       then JoinOperatorInfo
    when "windowInfo"             then WindowInfo
    when "tableWriter"            then TableWriterInfo
  end
  if model_class
     model_class.decode(hash)
  end
end