Class: Impala::Protocol::TTypeNode

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/impala/protocol/types_types.rb

Constant Summary collapse

TYPE =
1
SCALAR_TYPE =
2
STRUCT_FIELDS =
3
FIELDS =
{
  TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Impala::Protocol::TTypeNodeType},
  SCALAR_TYPE => {:type => ::Thrift::Types::STRUCT, :name => 'scalar_type', :class => ::Impala::Protocol::TScalarType, :optional => true},
  STRUCT_FIELDS => {:type => ::Thrift::Types::LIST, :name => 'struct_fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Impala::Protocol::TStructField}, :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



144
# File 'lib/impala/protocol/types_types.rb', line 144

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


146
147
148
149
150
151
# File 'lib/impala/protocol/types_types.rb', line 146

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
  unless @type.nil? || ::Impala::Protocol::TTypeNodeType::VALID_VALUES.include?(@type)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
  end
end