Module: Trino::Client::ModelVersions::V0_205::OperatorInfo

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

Overview

Inner classes

Class Method Summary collapse

Class Method Details

.decode(hash) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/trino/client/model_versions/0.205.rb', line 212

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