# # Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'types_types' require 'opcodes_types' module Impala module Protocol module TExprNodeType AGG_EXPR = 0 ARITHMETIC_EXPR = 1 BINARY_PRED = 2 BOOL_LITERAL = 3 CASE_EXPR = 4 CAST_EXPR = 5 COMPOUND_PRED = 6 DATE_LITERAL = 7 FLOAT_LITERAL = 8 FUNCTION_CALL = 9 INT_LITERAL = 10 IN_PRED = 11 IS_NULL_PRED = 12 LIKE_PRED = 13 LITERAL_PRED = 14 NULL_LITERAL = 15 SLOT_REF = 16 STRING_LITERAL = 17 VALUE_MAP = { 0 => "AGG_EXPR", 1 => "ARITHMETIC_EXPR", 2 => "BINARY_PRED", 3 => "BOOL_LITERAL", 4 => "CASE_EXPR", 5 => "CAST_EXPR", 6 => "COMPOUND_PRED", 7 => "DATE_LITERAL", 8 => "FLOAT_LITERAL", 9 => "FUNCTION_CALL", 10 => "INT_LITERAL", 11 => "IN_PRED", 12 => "IS_NULL_PRED", 13 => "LIKE_PRED", 14 => "LITERAL_PRED", 15 => "NULL_LITERAL", 16 => "SLOT_REF", 17 => "STRING_LITERAL" } VALID_VALUES = Set.new([AGG_EXPR, ARITHMETIC_EXPR, BINARY_PRED, BOOL_LITERAL, CASE_EXPR, CAST_EXPR, COMPOUND_PRED, DATE_LITERAL, FLOAT_LITERAL, FUNCTION_CALL, INT_LITERAL, IN_PRED, IS_NULL_PRED, LIKE_PRED, LITERAL_PRED, NULL_LITERAL, SLOT_REF, STRING_LITERAL]).freeze end module TAggregationOp INVALID = 0 COUNT = 1 MAX = 2 DISTINCT_PC = 3 MERGE_PC = 4 DISTINCT_PCSA = 5 MERGE_PCSA = 6 MIN = 7 SUM = 8 VALUE_MAP = { 0 => "INVALID", 1 => "COUNT", 2 => "MAX", 3 => "DISTINCT_PC", 4 => "MERGE_PC", 5 => "DISTINCT_PCSA", 6 => "MERGE_PCSA", 7 => "MIN", 8 => "SUM" } VALID_VALUES = Set.new([INVALID, COUNT, MAX, DISTINCT_PC, MERGE_PC, DISTINCT_PCSA, MERGE_PCSA, MIN, SUM]).freeze end class TAggregateExpr include ::Thrift::Struct, ::Thrift::Struct_Union IS_STAR = 1 IS_DISTINCT = 2 OP = 3 FIELDS = { IS_STAR => { :type => ::Thrift::Types::BOOL, :name => 'is_star' }, IS_DISTINCT => { :type => ::Thrift::Types::BOOL, :name => 'is_distinct' }, OP => { :type => ::Thrift::Types::I32, :name => 'op', :enum_class => Impala::Protocol::TAggregationOp } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field is_star is unset!') if @is_star.nil? raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field is_distinct is unset!') if @is_distinct.nil? raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field op is unset!') unless @op unless @op.nil? || Impala::Protocol::TAggregationOp::VALID_VALUES.include?(@op) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!') end end ::Thrift::Struct.generate_accessors self end class TBoolLiteral include ::Thrift::Struct, ::Thrift::Struct_Union VALUE = 1 FIELDS = { VALUE => { :type => ::Thrift::Types::BOOL, :name => 'value' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') if @value.nil? end ::Thrift::Struct.generate_accessors self end class TCaseExpr include ::Thrift::Struct, ::Thrift::Struct_Union HAS_CASE_EXPR = 1 HAS_ELSE_EXPR = 2 FIELDS = { HAS_CASE_EXPR => { :type => ::Thrift::Types::BOOL, :name => 'has_case_expr' }, HAS_ELSE_EXPR => { :type => ::Thrift::Types::BOOL, :name => 'has_else_expr' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field has_case_expr is unset!') if @has_case_expr.nil? raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field has_else_expr is unset!') if @has_else_expr.nil? end ::Thrift::Struct.generate_accessors self end class TDateLiteral include ::Thrift::Struct, ::Thrift::Struct_Union VALUE = 1 FIELDS = { VALUE => { :type => ::Thrift::Types::I64, :name => 'value' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value end ::Thrift::Struct.generate_accessors self end class TFloatLiteral include ::Thrift::Struct, ::Thrift::Struct_Union VALUE = 1 FIELDS = { VALUE => { :type => ::Thrift::Types::DOUBLE, :name => 'value' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value end ::Thrift::Struct.generate_accessors self end class TIntLiteral include ::Thrift::Struct, ::Thrift::Struct_Union VALUE = 1 FIELDS = { VALUE => { :type => ::Thrift::Types::I64, :name => 'value' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value end ::Thrift::Struct.generate_accessors self end class TInPredicate include ::Thrift::Struct, ::Thrift::Struct_Union IS_NOT_IN = 1 FIELDS = { IS_NOT_IN => { :type => ::Thrift::Types::BOOL, :name => 'is_not_in' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field is_not_in is unset!') if @is_not_in.nil? end ::Thrift::Struct.generate_accessors self end class TIsNullPredicate include ::Thrift::Struct, ::Thrift::Struct_Union IS_NOT_NULL = 1 FIELDS = { IS_NOT_NULL => { :type => ::Thrift::Types::BOOL, :name => 'is_not_null' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field is_not_null is unset!') if @is_not_null.nil? end ::Thrift::Struct.generate_accessors self end class TLikePredicate include ::Thrift::Struct, ::Thrift::Struct_Union ESCAPE_CHAR = 1 FIELDS = { ESCAPE_CHAR => { :type => ::Thrift::Types::STRING, :name => 'escape_char' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field escape_char is unset!') unless @escape_char end ::Thrift::Struct.generate_accessors self end class TLiteralPredicate include ::Thrift::Struct, ::Thrift::Struct_Union VALUE = 1 IS_NULL = 2 FIELDS = { VALUE => { :type => ::Thrift::Types::BOOL, :name => 'value' }, IS_NULL => { :type => ::Thrift::Types::BOOL, :name => 'is_null' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') if @value.nil? raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field is_null is unset!') if @is_null.nil? end ::Thrift::Struct.generate_accessors self end class TSlotRef include ::Thrift::Struct, ::Thrift::Struct_Union SLOT_ID = 1 FIELDS = { SLOT_ID => { :type => ::Thrift::Types::I32, :name => 'slot_id' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field slot_id is unset!') unless @slot_id end ::Thrift::Struct.generate_accessors self end class TStringLiteral include ::Thrift::Struct, ::Thrift::Struct_Union VALUE = 1 FIELDS = { VALUE => { :type => ::Thrift::Types::STRING, :name => 'value' } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value end ::Thrift::Struct.generate_accessors self end class TExprNode include ::Thrift::Struct, ::Thrift::Struct_Union 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 } } def struct_fields; FIELDS; end 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 ::Thrift::Struct.generate_accessors self end class TExpr include ::Thrift::Struct, ::Thrift::Struct_Union NODES = 1 FIELDS = { NODES => { :type => ::Thrift::Types::LIST, :name => 'nodes', :element => { :type => ::Thrift::Types::STRUCT, :class => Impala::Protocol::TExprNode } } } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nodes is unset!') unless @nodes end ::Thrift::Struct.generate_accessors self end end end