Class: Impala::Protocol::TExprNode

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

Constant Summary collapse

NODE_TYPE =
1
TYPE =
2
OPCODE =
3
NUM_CHILDREN =
4
AGG_EXPR =
5
BOOL_LITERAL =
6
CASE_EXPR =
7
DATE_LITERAL =
8
FLOAT_LITERAL =
9
INT_LITERAL =
10
IN_PREDICATE =
11
IS_NULL_PRED =
12
LIKE_PRED =
13
LITERAL_PRED =
14
SLOT_REF =
15
STRING_LITERAL =
16
FIELDS =
{
NODE_TYPE => { :type => ::Thrift::Types::I32, :name => 'node_type', :enum_class => Impala::Protocol::TExprNodeType },
TYPE => { :type => ::Thrift::Types::I32, :name => 'type', :enum_class => Impala::Protocol::TPrimitiveType },
OPCODE => { :type => ::Thrift::Types::I32, :name => 'opcode', :optional => true, :enum_class => Impala::Protocol::TExprOpcode },
NUM_CHILDREN => { :type => ::Thrift::Types::I32, :name => 'num_children' },
AGG_EXPR => { :type => ::Thrift::Types::STRUCT, :name => 'agg_expr', :class => Impala::Protocol::TAggregateExpr, :optional => true },
BOOL_LITERAL => { :type => ::Thrift::Types::STRUCT, :name => 'bool_literal', :class => Impala::Protocol::TBoolLiteral, :optional => true },
CASE_EXPR => { :type => ::Thrift::Types::STRUCT, :name => 'case_expr', :class => Impala::Protocol::TCaseExpr, :optional => true },
DATE_LITERAL => { :type => ::Thrift::Types::STRUCT, :name => 'date_literal', :class => Impala::Protocol::TDateLiteral, :optional => true },
FLOAT_LITERAL => { :type => ::Thrift::Types::STRUCT, :name => 'float_literal', :class => Impala::Protocol::TFloatLiteral, :optional => true },
INT_LITERAL => { :type => ::Thrift::Types::STRUCT, :name => 'int_literal', :class => Impala::Protocol::TIntLiteral, :optional => true },
IN_PREDICATE => { :type => ::Thrift::Types::STRUCT, :name => 'in_predicate', :class => Impala::Protocol::TInPredicate, :optional => true },
IS_NULL_PRED => { :type => ::Thrift::Types::STRUCT, :name => 'is_null_pred', :class => Impala::Protocol::TIsNullPredicate, :optional => true },
LIKE_PRED => { :type => ::Thrift::Types::STRUCT, :name => 'like_pred', :class => Impala::Protocol::TLikePredicate, :optional => true },
LITERAL_PRED => { :type => ::Thrift::Types::STRUCT, :name => 'literal_pred', :class => Impala::Protocol::TLiteralPredicate, :optional => true },
SLOT_REF => { :type => ::Thrift::Types::STRUCT, :name => 'slot_ref', :class => Impala::Protocol::TSlotRef, :optional => true },
STRING_LITERAL => { :type => ::Thrift::Types::STRUCT, :name => 'string_literal', :class => Impala::Protocol::TStringLiteral, :optional => true }
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



307
# File 'lib/impala/protocol/exprs_types.rb', line 307

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/impala/protocol/exprs_types.rb', line 309

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