module PrestoLegacy::Client::Models::WindowNode

Public Class Methods

decode(hash) click to toggle source
# File lib/presto_legacy/client/models.rb, line 1497
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["id"],
    hash["source"] && PlanNode.decode(hash["source"]),
    hash["partitionBy"],
    hash["orderBy"],
    hash["orderings"] && Hash[hash["orderings"].to_a.map! {|k,v| [k, v.downcase.to_sym] }],
    hash["frame"],
    hash["windowFunctions"],
    hash["signatures"] && Hash[hash["signatures"].to_a.map! {|k,v| [k, Signature.decode(v)] }],
    hash["hashSymbol"],
    hash["prePartitionedInputs"],
    hash["preSortedOrderPrefix"],
  )
  obj
end