#
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

from thrift.Thrift import TType as TTType
from thrift.Thrift import *

from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class TProtocolVersion(object):
  HIVE_CLI_SERVICE_PROTOCOL_V1 = 0

  _VALUES_TO_NAMES = {
    0: "HIVE_CLI_SERVICE_PROTOCOL_V1",
  }

  _NAMES_TO_VALUES = {
    "HIVE_CLI_SERVICE_PROTOCOL_V1": 0,
  }

class TType(object):
  BOOLEAN_TYPE = 0
  TINYINT_TYPE = 1
  SMALLINT_TYPE = 2
  INT_TYPE = 3
  BIGINT_TYPE = 4
  FLOAT_TYPE = 5
  DOUBLE_TYPE = 6
  STRING_TYPE = 7
  TIMESTAMP_TYPE = 8
  BINARY_TYPE = 9
  ARRAY_TYPE = 10
  MAP_TYPE = 11
  STRUCT_TYPE = 12
  UNION_TYPE = 13
  USER_DEFINED_TYPE = 14

  _VALUES_TO_NAMES = {
    0: "BOOLEAN_TYPE",
    1: "TINYINT_TYPE",
    2: "SMALLINT_TYPE",
    3: "INT_TYPE",
    4: "BIGINT_TYPE",
    5: "FLOAT_TYPE",
    6: "DOUBLE_TYPE",
    7: "STRING_TYPE",
    8: "TIMESTAMP_TYPE",
    9: "BINARY_TYPE",
    10: "ARRAY_TYPE",
    11: "MAP_TYPE",
    12: "STRUCT_TYPE",
    13: "UNION_TYPE",
    14: "USER_DEFINED_TYPE",
  }

  _NAMES_TO_VALUES = {
    "BOOLEAN_TYPE": 0,
    "TINYINT_TYPE": 1,
    "SMALLINT_TYPE": 2,
    "INT_TYPE": 3,
    "BIGINT_TYPE": 4,
    "FLOAT_TYPE": 5,
    "DOUBLE_TYPE": 6,
    "STRING_TYPE": 7,
    "TIMESTAMP_TYPE": 8,
    "BINARY_TYPE": 9,
    "ARRAY_TYPE": 10,
    "MAP_TYPE": 11,
    "STRUCT_TYPE": 12,
    "UNION_TYPE": 13,
    "USER_DEFINED_TYPE": 14,
  }

class TStatusCode(object):
  SUCCESS_STATUS = 0
  SUCCESS_WITH_INFO_STATUS = 1
  STILL_EXECUTING_STATUS = 2
  ERROR_STATUS = 3
  INVALID_HANDLE_STATUS = 4

  _VALUES_TO_NAMES = {
    0: "SUCCESS_STATUS",
    1: "SUCCESS_WITH_INFO_STATUS",
    2: "STILL_EXECUTING_STATUS",
    3: "ERROR_STATUS",
    4: "INVALID_HANDLE_STATUS",
  }

  _NAMES_TO_VALUES = {
    "SUCCESS_STATUS": 0,
    "SUCCESS_WITH_INFO_STATUS": 1,
    "STILL_EXECUTING_STATUS": 2,
    "ERROR_STATUS": 3,
    "INVALID_HANDLE_STATUS": 4,
  }

class TOperationState(object):
  INITIALIZED_STATE = 0
  RUNNING_STATE = 1
  FINISHED_STATE = 2
  CANCELED_STATE = 3
  CLOSED_STATE = 4
  ERROR_STATE = 5
  UKNOWN_STATE = 6

  _VALUES_TO_NAMES = {
    0: "INITIALIZED_STATE",
    1: "RUNNING_STATE",
    2: "FINISHED_STATE",
    3: "CANCELED_STATE",
    4: "CLOSED_STATE",
    5: "ERROR_STATE",
    6: "UKNOWN_STATE",
  }

  _NAMES_TO_VALUES = {
    "INITIALIZED_STATE": 0,
    "RUNNING_STATE": 1,
    "FINISHED_STATE": 2,
    "CANCELED_STATE": 3,
    "CLOSED_STATE": 4,
    "ERROR_STATE": 5,
    "UKNOWN_STATE": 6,
  }

class TOperationType(object):
  EXECUTE_STATEMENT = 0
  GET_TYPE_INFO = 1
  GET_CATALOGS = 2
  GET_SCHEMAS = 3
  GET_TABLES = 4
  GET_TABLE_TYPES = 5
  GET_COLUMNS = 6
  GET_FUNCTIONS = 7
  UNKNOWN = 8

  _VALUES_TO_NAMES = {
    0: "EXECUTE_STATEMENT",
    1: "GET_TYPE_INFO",
    2: "GET_CATALOGS",
    3: "GET_SCHEMAS",
    4: "GET_TABLES",
    5: "GET_TABLE_TYPES",
    6: "GET_COLUMNS",
    7: "GET_FUNCTIONS",
    8: "UNKNOWN",
  }

  _NAMES_TO_VALUES = {
    "EXECUTE_STATEMENT": 0,
    "GET_TYPE_INFO": 1,
    "GET_CATALOGS": 2,
    "GET_SCHEMAS": 3,
    "GET_TABLES": 4,
    "GET_TABLE_TYPES": 5,
    "GET_COLUMNS": 6,
    "GET_FUNCTIONS": 7,
    "UNKNOWN": 8,
  }

class TGetInfoType(object):
  CLI_MAX_DRIVER_CONNECTIONS = 0
  CLI_MAX_CONCURRENT_ACTIVITIES = 1
  CLI_DATA_SOURCE_NAME = 2
  CLI_FETCH_DIRECTION = 8
  CLI_SERVER_NAME = 13
  CLI_SEARCH_PATTERN_ESCAPE = 14
  CLI_DBMS_NAME = 17
  CLI_DBMS_VER = 18
  CLI_ACCESSIBLE_TABLES = 19
  CLI_ACCESSIBLE_PROCEDURES = 20
  CLI_CURSOR_COMMIT_BEHAVIOR = 23
  CLI_DATA_SOURCE_READ_ONLY = 25
  CLI_DEFAULT_TXN_ISOLATION = 26
  CLI_IDENTIFIER_CASE = 28
  CLI_IDENTIFIER_QUOTE_CHAR = 29
  CLI_MAX_COLUMN_NAME_LEN = 30
  CLI_MAX_CURSOR_NAME_LEN = 31
  CLI_MAX_SCHEMA_NAME_LEN = 32
  CLI_MAX_CATALOG_NAME_LEN = 34
  CLI_MAX_TABLE_NAME_LEN = 35
  CLI_SCROLL_CONCURRENCY = 43
  CLI_TXN_CAPABLE = 46
  CLI_USER_NAME = 47
  CLI_TXN_ISOLATION_OPTION = 72
  CLI_INTEGRITY = 73
  CLI_GETDATA_EXTENSIONS = 81
  CLI_NULL_COLLATION = 85
  CLI_ALTER_TABLE = 86
  CLI_ORDER_BY_COLUMNS_IN_SELECT = 90
  CLI_SPECIAL_CHARACTERS = 94
  CLI_MAX_COLUMNS_IN_GROUP_BY = 97
  CLI_MAX_COLUMNS_IN_INDEX = 98
  CLI_MAX_COLUMNS_IN_ORDER_BY = 99
  CLI_MAX_COLUMNS_IN_SELECT = 100
  CLI_MAX_COLUMNS_IN_TABLE = 101
  CLI_MAX_INDEX_SIZE = 102
  CLI_MAX_ROW_SIZE = 104
  CLI_MAX_STATEMENT_LEN = 105
  CLI_MAX_TABLES_IN_SELECT = 106
  CLI_MAX_USER_NAME_LEN = 107
  CLI_OJ_CAPABILITIES = 115
  CLI_XOPEN_CLI_YEAR = 10000
  CLI_CURSOR_SENSITIVITY = 10001
  CLI_DESCRIBE_PARAMETER = 10002
  CLI_CATALOG_NAME = 10003
  CLI_COLLATION_SEQ = 10004
  CLI_MAX_IDENTIFIER_LEN = 10005

  _VALUES_TO_NAMES = {
    0: "CLI_MAX_DRIVER_CONNECTIONS",
    1: "CLI_MAX_CONCURRENT_ACTIVITIES",
    2: "CLI_DATA_SOURCE_NAME",
    8: "CLI_FETCH_DIRECTION",
    13: "CLI_SERVER_NAME",
    14: "CLI_SEARCH_PATTERN_ESCAPE",
    17: "CLI_DBMS_NAME",
    18: "CLI_DBMS_VER",
    19: "CLI_ACCESSIBLE_TABLES",
    20: "CLI_ACCESSIBLE_PROCEDURES",
    23: "CLI_CURSOR_COMMIT_BEHAVIOR",
    25: "CLI_DATA_SOURCE_READ_ONLY",
    26: "CLI_DEFAULT_TXN_ISOLATION",
    28: "CLI_IDENTIFIER_CASE",
    29: "CLI_IDENTIFIER_QUOTE_CHAR",
    30: "CLI_MAX_COLUMN_NAME_LEN",
    31: "CLI_MAX_CURSOR_NAME_LEN",
    32: "CLI_MAX_SCHEMA_NAME_LEN",
    34: "CLI_MAX_CATALOG_NAME_LEN",
    35: "CLI_MAX_TABLE_NAME_LEN",
    43: "CLI_SCROLL_CONCURRENCY",
    46: "CLI_TXN_CAPABLE",
    47: "CLI_USER_NAME",
    72: "CLI_TXN_ISOLATION_OPTION",
    73: "CLI_INTEGRITY",
    81: "CLI_GETDATA_EXTENSIONS",
    85: "CLI_NULL_COLLATION",
    86: "CLI_ALTER_TABLE",
    90: "CLI_ORDER_BY_COLUMNS_IN_SELECT",
    94: "CLI_SPECIAL_CHARACTERS",
    97: "CLI_MAX_COLUMNS_IN_GROUP_BY",
    98: "CLI_MAX_COLUMNS_IN_INDEX",
    99: "CLI_MAX_COLUMNS_IN_ORDER_BY",
    100: "CLI_MAX_COLUMNS_IN_SELECT",
    101: "CLI_MAX_COLUMNS_IN_TABLE",
    102: "CLI_MAX_INDEX_SIZE",
    104: "CLI_MAX_ROW_SIZE",
    105: "CLI_MAX_STATEMENT_LEN",
    106: "CLI_MAX_TABLES_IN_SELECT",
    107: "CLI_MAX_USER_NAME_LEN",
    115: "CLI_OJ_CAPABILITIES",
    10000: "CLI_XOPEN_CLI_YEAR",
    10001: "CLI_CURSOR_SENSITIVITY",
    10002: "CLI_DESCRIBE_PARAMETER",
    10003: "CLI_CATALOG_NAME",
    10004: "CLI_COLLATION_SEQ",
    10005: "CLI_MAX_IDENTIFIER_LEN",
  }

  _NAMES_TO_VALUES = {
    "CLI_MAX_DRIVER_CONNECTIONS": 0,
    "CLI_MAX_CONCURRENT_ACTIVITIES": 1,
    "CLI_DATA_SOURCE_NAME": 2,
    "CLI_FETCH_DIRECTION": 8,
    "CLI_SERVER_NAME": 13,
    "CLI_SEARCH_PATTERN_ESCAPE": 14,
    "CLI_DBMS_NAME": 17,
    "CLI_DBMS_VER": 18,
    "CLI_ACCESSIBLE_TABLES": 19,
    "CLI_ACCESSIBLE_PROCEDURES": 20,
    "CLI_CURSOR_COMMIT_BEHAVIOR": 23,
    "CLI_DATA_SOURCE_READ_ONLY": 25,
    "CLI_DEFAULT_TXN_ISOLATION": 26,
    "CLI_IDENTIFIER_CASE": 28,
    "CLI_IDENTIFIER_QUOTE_CHAR": 29,
    "CLI_MAX_COLUMN_NAME_LEN": 30,
    "CLI_MAX_CURSOR_NAME_LEN": 31,
    "CLI_MAX_SCHEMA_NAME_LEN": 32,
    "CLI_MAX_CATALOG_NAME_LEN": 34,
    "CLI_MAX_TABLE_NAME_LEN": 35,
    "CLI_SCROLL_CONCURRENCY": 43,
    "CLI_TXN_CAPABLE": 46,
    "CLI_USER_NAME": 47,
    "CLI_TXN_ISOLATION_OPTION": 72,
    "CLI_INTEGRITY": 73,
    "CLI_GETDATA_EXTENSIONS": 81,
    "CLI_NULL_COLLATION": 85,
    "CLI_ALTER_TABLE": 86,
    "CLI_ORDER_BY_COLUMNS_IN_SELECT": 90,
    "CLI_SPECIAL_CHARACTERS": 94,
    "CLI_MAX_COLUMNS_IN_GROUP_BY": 97,
    "CLI_MAX_COLUMNS_IN_INDEX": 98,
    "CLI_MAX_COLUMNS_IN_ORDER_BY": 99,
    "CLI_MAX_COLUMNS_IN_SELECT": 100,
    "CLI_MAX_COLUMNS_IN_TABLE": 101,
    "CLI_MAX_INDEX_SIZE": 102,
    "CLI_MAX_ROW_SIZE": 104,
    "CLI_MAX_STATEMENT_LEN": 105,
    "CLI_MAX_TABLES_IN_SELECT": 106,
    "CLI_MAX_USER_NAME_LEN": 107,
    "CLI_OJ_CAPABILITIES": 115,
    "CLI_XOPEN_CLI_YEAR": 10000,
    "CLI_CURSOR_SENSITIVITY": 10001,
    "CLI_DESCRIBE_PARAMETER": 10002,
    "CLI_CATALOG_NAME": 10003,
    "CLI_COLLATION_SEQ": 10004,
    "CLI_MAX_IDENTIFIER_LEN": 10005,
  }

class TFetchOrientation(object):
  FETCH_NEXT = 0
  FETCH_PRIOR = 1
  FETCH_RELATIVE = 2
  FETCH_ABSOLUTE = 3
  FETCH_FIRST = 4
  FETCH_LAST = 5

  _VALUES_TO_NAMES = {
    0: "FETCH_NEXT",
    1: "FETCH_PRIOR",
    2: "FETCH_RELATIVE",
    3: "FETCH_ABSOLUTE",
    4: "FETCH_FIRST",
    5: "FETCH_LAST",
  }

  _NAMES_TO_VALUES = {
    "FETCH_NEXT": 0,
    "FETCH_PRIOR": 1,
    "FETCH_RELATIVE": 2,
    "FETCH_ABSOLUTE": 3,
    "FETCH_FIRST": 4,
    "FETCH_LAST": 5,
  }


class TPrimitiveTypeEntry(object):
  """
  Attributes:
   - type
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I32, 'type', None, None, ), # 1
  )

  def __init__(self, type=None,):
    self.type = type

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I32:
          self.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TPrimitiveTypeEntry')
    if self.type is not None:
      oprot.writeFieldBegin('type', TTType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.type is None:
      raise TProtocol.TProtocolException(message='Required field type is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TArrayTypeEntry(object):
  """
  Attributes:
   - objectTypePtr
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I32, 'objectTypePtr', None, None, ), # 1
  )

  def __init__(self, objectTypePtr=None,):
    self.objectTypePtr = objectTypePtr

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I32:
          self.objectTypePtr = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TArrayTypeEntry')
    if self.objectTypePtr is not None:
      oprot.writeFieldBegin('objectTypePtr', TTType.I32, 1)
      oprot.writeI32(self.objectTypePtr)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.objectTypePtr is None:
      raise TProtocol.TProtocolException(message='Required field objectTypePtr is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TMapTypeEntry(object):
  """
  Attributes:
   - keyTypePtr
   - valueTypePtr
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I32, 'keyTypePtr', None, None, ), # 1
    (2, TTType.I32, 'valueTypePtr', None, None, ), # 2
  )

  def __init__(self, keyTypePtr=None, valueTypePtr=None,):
    self.keyTypePtr = keyTypePtr
    self.valueTypePtr = valueTypePtr

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I32:
          self.keyTypePtr = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.I32:
          self.valueTypePtr = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TMapTypeEntry')
    if self.keyTypePtr is not None:
      oprot.writeFieldBegin('keyTypePtr', TTType.I32, 1)
      oprot.writeI32(self.keyTypePtr)
      oprot.writeFieldEnd()
    if self.valueTypePtr is not None:
      oprot.writeFieldBegin('valueTypePtr', TTType.I32, 2)
      oprot.writeI32(self.valueTypePtr)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.keyTypePtr is None:
      raise TProtocol.TProtocolException(message='Required field keyTypePtr is unset!')
    if self.valueTypePtr is None:
      raise TProtocol.TProtocolException(message='Required field valueTypePtr is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TStructTypeEntry(object):
  """
  Attributes:
   - nameToTypePtr
  """

  thrift_spec = (
    None, # 0
    (1, TTType.MAP, 'nameToTypePtr', (TTType.STRING,None,TTType.I32,None), None, ), # 1
  )

  def __init__(self, nameToTypePtr=None,):
    self.nameToTypePtr = nameToTypePtr

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.MAP:
          self.nameToTypePtr = {}
          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin() 
          for _i4 in xrange(_size0):
            _key5 = iprot.readString();
            _val6 = iprot.readI32();
            self.nameToTypePtr[_key5] = _val6
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TStructTypeEntry')
    if self.nameToTypePtr is not None:
      oprot.writeFieldBegin('nameToTypePtr', TTType.MAP, 1)
      oprot.writeMapBegin(TTType.STRING, TTType.I32, len(self.nameToTypePtr))
      for kiter7,viter8 in self.nameToTypePtr.items():
        oprot.writeString(kiter7)
        oprot.writeI32(viter8)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.nameToTypePtr is None:
      raise TProtocol.TProtocolException(message='Required field nameToTypePtr is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TUnionTypeEntry(object):
  """
  Attributes:
   - nameToTypePtr
  """

  thrift_spec = (
    None, # 0
    (1, TTType.MAP, 'nameToTypePtr', (TTType.STRING,None,TTType.I32,None), None, ), # 1
  )

  def __init__(self, nameToTypePtr=None,):
    self.nameToTypePtr = nameToTypePtr

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.MAP:
          self.nameToTypePtr = {}
          (_ktype10, _vtype11, _size9 ) = iprot.readMapBegin() 
          for _i13 in xrange(_size9):
            _key14 = iprot.readString();
            _val15 = iprot.readI32();
            self.nameToTypePtr[_key14] = _val15
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TUnionTypeEntry')
    if self.nameToTypePtr is not None:
      oprot.writeFieldBegin('nameToTypePtr', TTType.MAP, 1)
      oprot.writeMapBegin(TTType.STRING, TTType.I32, len(self.nameToTypePtr))
      for kiter16,viter17 in self.nameToTypePtr.items():
        oprot.writeString(kiter16)
        oprot.writeI32(viter17)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.nameToTypePtr is None:
      raise TProtocol.TProtocolException(message='Required field nameToTypePtr is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TUserDefinedTypeEntry(object):
  """
  Attributes:
   - typeClassName
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRING, 'typeClassName', None, None, ), # 1
  )

  def __init__(self, typeClassName=None,):
    self.typeClassName = typeClassName

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRING:
          self.typeClassName = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TUserDefinedTypeEntry')
    if self.typeClassName is not None:
      oprot.writeFieldBegin('typeClassName', TTType.STRING, 1)
      oprot.writeString(self.typeClassName)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.typeClassName is None:
      raise TProtocol.TProtocolException(message='Required field typeClassName is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TTypeEntry(object):
  """
  Attributes:
   - primitiveEntry
   - arrayEntry
   - mapEntry
   - structEntry
   - unionEntry
   - userDefinedTypeEntry
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'primitiveEntry', (TPrimitiveTypeEntry, TPrimitiveTypeEntry.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'arrayEntry', (TArrayTypeEntry, TArrayTypeEntry.thrift_spec), None, ), # 2
    (3, TTType.STRUCT, 'mapEntry', (TMapTypeEntry, TMapTypeEntry.thrift_spec), None, ), # 3
    (4, TTType.STRUCT, 'structEntry', (TStructTypeEntry, TStructTypeEntry.thrift_spec), None, ), # 4
    (5, TTType.STRUCT, 'unionEntry', (TUnionTypeEntry, TUnionTypeEntry.thrift_spec), None, ), # 5
    (6, TTType.STRUCT, 'userDefinedTypeEntry', (TUserDefinedTypeEntry, TUserDefinedTypeEntry.thrift_spec), None, ), # 6
  )

  def __init__(self, primitiveEntry=None, arrayEntry=None, mapEntry=None, structEntry=None, unionEntry=None, userDefinedTypeEntry=None,):
    self.primitiveEntry = primitiveEntry
    self.arrayEntry = arrayEntry
    self.mapEntry = mapEntry
    self.structEntry = structEntry
    self.unionEntry = unionEntry
    self.userDefinedTypeEntry = userDefinedTypeEntry

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.primitiveEntry = TPrimitiveTypeEntry()
          self.primitiveEntry.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.arrayEntry = TArrayTypeEntry()
          self.arrayEntry.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRUCT:
          self.mapEntry = TMapTypeEntry()
          self.mapEntry.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.STRUCT:
          self.structEntry = TStructTypeEntry()
          self.structEntry.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TTType.STRUCT:
          self.unionEntry = TUnionTypeEntry()
          self.unionEntry.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TTType.STRUCT:
          self.userDefinedTypeEntry = TUserDefinedTypeEntry()
          self.userDefinedTypeEntry.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TTTypeEntry')
    if self.primitiveEntry is not None:
      oprot.writeFieldBegin('primitiveEntry', TTType.STRUCT, 1)
      self.primitiveEntry.write(oprot)
      oprot.writeFieldEnd()
    if self.arrayEntry is not None:
      oprot.writeFieldBegin('arrayEntry', TTType.STRUCT, 2)
      self.arrayEntry.write(oprot)
      oprot.writeFieldEnd()
    if self.mapEntry is not None:
      oprot.writeFieldBegin('mapEntry', TTType.STRUCT, 3)
      self.mapEntry.write(oprot)
      oprot.writeFieldEnd()
    if self.structEntry is not None:
      oprot.writeFieldBegin('structEntry', TTType.STRUCT, 4)
      self.structEntry.write(oprot)
      oprot.writeFieldEnd()
    if self.unionEntry is not None:
      oprot.writeFieldBegin('unionEntry', TTType.STRUCT, 5)
      self.unionEntry.write(oprot)
      oprot.writeFieldEnd()
    if self.userDefinedTypeEntry is not None:
      oprot.writeFieldBegin('userDefinedTypeEntry', TTType.STRUCT, 6)
      self.userDefinedTypeEntry.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TTypeDesc(object):
  """
  Attributes:
   - types
  """

  thrift_spec = (
    None, # 0
    (1, TTType.LIST, 'types', (TTType.STRUCT,(TTypeEntry, TTypeEntry.thrift_spec)), None, ), # 1
  )

  def __init__(self, types=None,):
    self.types = types

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.LIST:
          self.types = []
          (_etype21, _size18) = iprot.readListBegin()
          for _i22 in xrange(_size18):
            _elem23 = TTypeEntry()
            _elem23.read(iprot)
            self.types.append(_elem23)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TTypeDesc')
    if self.types is not None:
      oprot.writeFieldBegin('types', TTType.LIST, 1)
      oprot.writeListBegin(TTType.STRUCT, len(self.types))
      for iter24 in self.types:
        iter24.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.types is None:
      raise TProtocol.TProtocolException(message='Required field types is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TColumnDesc(object):
  """
  Attributes:
   - columnName
   - typeDesc
   - position
   - comment
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRING, 'columnName', None, None, ), # 1
    (2, TTType.STRUCT, 'typeDesc', (TTypeDesc, TTypeDesc.thrift_spec), None, ), # 2
    (3, TTType.I32, 'position', None, None, ), # 3
    (4, TTType.STRING, 'comment', None, None, ), # 4
  )

  def __init__(self, columnName=None, typeDesc=None, position=None, comment=None,):
    self.columnName = columnName
    self.typeDesc = typeDesc
    self.position = position
    self.comment = comment

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRING:
          self.columnName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.typeDesc = TTypeDesc()
          self.typeDesc.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.I32:
          self.position = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.STRING:
          self.comment = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TColumnDesc')
    if self.columnName is not None:
      oprot.writeFieldBegin('columnName', TTType.STRING, 1)
      oprot.writeString(self.columnName)
      oprot.writeFieldEnd()
    if self.typeDesc is not None:
      oprot.writeFieldBegin('typeDesc', TTType.STRUCT, 2)
      self.typeDesc.write(oprot)
      oprot.writeFieldEnd()
    if self.position is not None:
      oprot.writeFieldBegin('position', TTType.I32, 3)
      oprot.writeI32(self.position)
      oprot.writeFieldEnd()
    if self.comment is not None:
      oprot.writeFieldBegin('comment', TTType.STRING, 4)
      oprot.writeString(self.comment)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.columnName is None:
      raise TProtocol.TProtocolException(message='Required field columnName is unset!')
    if self.typeDesc is None:
      raise TProtocol.TProtocolException(message='Required field typeDesc is unset!')
    if self.position is None:
      raise TProtocol.TProtocolException(message='Required field position is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TTableSchema(object):
  """
  Attributes:
   - columns
  """

  thrift_spec = (
    None, # 0
    (1, TTType.LIST, 'columns', (TTType.STRUCT,(TColumnDesc, TColumnDesc.thrift_spec)), None, ), # 1
  )

  def __init__(self, columns=None,):
    self.columns = columns

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.LIST:
          self.columns = []
          (_etype28, _size25) = iprot.readListBegin()
          for _i29 in xrange(_size25):
            _elem30 = TColumnDesc()
            _elem30.read(iprot)
            self.columns.append(_elem30)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TTableSchema')
    if self.columns is not None:
      oprot.writeFieldBegin('columns', TTType.LIST, 1)
      oprot.writeListBegin(TTType.STRUCT, len(self.columns))
      for iter31 in self.columns:
        iter31.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.columns is None:
      raise TProtocol.TProtocolException(message='Required field columns is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TBoolValue(object):
  """
  Attributes:
   - value
  """

  thrift_spec = (
    None, # 0
    (1, TTType.BOOL, 'value', None, None, ), # 1
  )

  def __init__(self, value=None,):
    self.value = value

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.BOOL:
          self.value = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TBoolValue')
    if self.value is not None:
      oprot.writeFieldBegin('value', TTType.BOOL, 1)
      oprot.writeBool(self.value)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TByteValue(object):
  """
  Attributes:
   - value
  """

  thrift_spec = (
    None, # 0
    (1, TTType.BYTE, 'value', None, None, ), # 1
  )

  def __init__(self, value=None,):
    self.value = value

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.BYTE:
          self.value = iprot.readByte();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TByteValue')
    if self.value is not None:
      oprot.writeFieldBegin('value', TTType.BYTE, 1)
      oprot.writeByte(self.value)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TI16Value(object):
  """
  Attributes:
   - value
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I16, 'value', None, None, ), # 1
  )

  def __init__(self, value=None,):
    self.value = value

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I16:
          self.value = iprot.readI16();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TI16Value')
    if self.value is not None:
      oprot.writeFieldBegin('value', TTType.I16, 1)
      oprot.writeI16(self.value)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TI32Value(object):
  """
  Attributes:
   - value
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I32, 'value', None, None, ), # 1
  )

  def __init__(self, value=None,):
    self.value = value

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I32:
          self.value = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TI32Value')
    if self.value is not None:
      oprot.writeFieldBegin('value', TTType.I32, 1)
      oprot.writeI32(self.value)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TI64Value(object):
  """
  Attributes:
   - value
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I64, 'value', None, None, ), # 1
  )

  def __init__(self, value=None,):
    self.value = value

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I64:
          self.value = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TI64Value')
    if self.value is not None:
      oprot.writeFieldBegin('value', TTType.I64, 1)
      oprot.writeI64(self.value)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TDoubleValue(object):
  """
  Attributes:
   - value
  """

  thrift_spec = (
    None, # 0
    (1, TTType.DOUBLE, 'value', None, None, ), # 1
  )

  def __init__(self, value=None,):
    self.value = value

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.DOUBLE:
          self.value = iprot.readDouble();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TDoubleValue')
    if self.value is not None:
      oprot.writeFieldBegin('value', TTType.DOUBLE, 1)
      oprot.writeDouble(self.value)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TStringValue(object):
  """
  Attributes:
   - value
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRING, 'value', None, None, ), # 1
  )

  def __init__(self, value=None,):
    self.value = value

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRING:
          self.value = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TStringValue')
    if self.value is not None:
      oprot.writeFieldBegin('value', TTType.STRING, 1)
      oprot.writeString(self.value)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TColumn(object):
  """
  Attributes:
   - boolColumn
   - byteColumn
   - i16Column
   - i32Column
   - i64Column
   - doubleColumn
   - stringColumn
  """

  thrift_spec = (
    None, # 0
    (1, TTType.LIST, 'boolColumn', (TTType.STRUCT,(TBoolValue, TBoolValue.thrift_spec)), None, ), # 1
    (2, TTType.LIST, 'byteColumn', (TTType.STRUCT,(TByteValue, TByteValue.thrift_spec)), None, ), # 2
    (3, TTType.LIST, 'i16Column', (TTType.STRUCT,(TI16Value, TI16Value.thrift_spec)), None, ), # 3
    (4, TTType.LIST, 'i32Column', (TTType.STRUCT,(TI32Value, TI32Value.thrift_spec)), None, ), # 4
    (5, TTType.LIST, 'i64Column', (TTType.STRUCT,(TI64Value, TI64Value.thrift_spec)), None, ), # 5
    (6, TTType.LIST, 'doubleColumn', (TTType.STRUCT,(TDoubleValue, TDoubleValue.thrift_spec)), None, ), # 6
    (7, TTType.LIST, 'stringColumn', (TTType.STRUCT,(TStringValue, TStringValue.thrift_spec)), None, ), # 7
  )

  def __init__(self, boolColumn=None, byteColumn=None, i16Column=None, i32Column=None, i64Column=None, doubleColumn=None, stringColumn=None,):
    self.boolColumn = boolColumn
    self.byteColumn = byteColumn
    self.i16Column = i16Column
    self.i32Column = i32Column
    self.i64Column = i64Column
    self.doubleColumn = doubleColumn
    self.stringColumn = stringColumn

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.LIST:
          self.boolColumn = []
          (_etype35, _size32) = iprot.readListBegin()
          for _i36 in xrange(_size32):
            _elem37 = TBoolValue()
            _elem37.read(iprot)
            self.boolColumn.append(_elem37)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.LIST:
          self.byteColumn = []
          (_etype41, _size38) = iprot.readListBegin()
          for _i42 in xrange(_size38):
            _elem43 = TByteValue()
            _elem43.read(iprot)
            self.byteColumn.append(_elem43)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.LIST:
          self.i16Column = []
          (_etype47, _size44) = iprot.readListBegin()
          for _i48 in xrange(_size44):
            _elem49 = TI16Value()
            _elem49.read(iprot)
            self.i16Column.append(_elem49)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.LIST:
          self.i32Column = []
          (_etype53, _size50) = iprot.readListBegin()
          for _i54 in xrange(_size50):
            _elem55 = TI32Value()
            _elem55.read(iprot)
            self.i32Column.append(_elem55)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TTType.LIST:
          self.i64Column = []
          (_etype59, _size56) = iprot.readListBegin()
          for _i60 in xrange(_size56):
            _elem61 = TI64Value()
            _elem61.read(iprot)
            self.i64Column.append(_elem61)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TTType.LIST:
          self.doubleColumn = []
          (_etype65, _size62) = iprot.readListBegin()
          for _i66 in xrange(_size62):
            _elem67 = TDoubleValue()
            _elem67.read(iprot)
            self.doubleColumn.append(_elem67)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TTType.LIST:
          self.stringColumn = []
          (_etype71, _size68) = iprot.readListBegin()
          for _i72 in xrange(_size68):
            _elem73 = TStringValue()
            _elem73.read(iprot)
            self.stringColumn.append(_elem73)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TColumn')
    if self.boolColumn is not None:
      oprot.writeFieldBegin('boolColumn', TTType.LIST, 1)
      oprot.writeListBegin(TTType.STRUCT, len(self.boolColumn))
      for iter74 in self.boolColumn:
        iter74.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.byteColumn is not None:
      oprot.writeFieldBegin('byteColumn', TTType.LIST, 2)
      oprot.writeListBegin(TTType.STRUCT, len(self.byteColumn))
      for iter75 in self.byteColumn:
        iter75.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.i16Column is not None:
      oprot.writeFieldBegin('i16Column', TTType.LIST, 3)
      oprot.writeListBegin(TTType.STRUCT, len(self.i16Column))
      for iter76 in self.i16Column:
        iter76.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.i32Column is not None:
      oprot.writeFieldBegin('i32Column', TTType.LIST, 4)
      oprot.writeListBegin(TTType.STRUCT, len(self.i32Column))
      for iter77 in self.i32Column:
        iter77.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.i64Column is not None:
      oprot.writeFieldBegin('i64Column', TTType.LIST, 5)
      oprot.writeListBegin(TTType.STRUCT, len(self.i64Column))
      for iter78 in self.i64Column:
        iter78.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.doubleColumn is not None:
      oprot.writeFieldBegin('doubleColumn', TTType.LIST, 6)
      oprot.writeListBegin(TTType.STRUCT, len(self.doubleColumn))
      for iter79 in self.doubleColumn:
        iter79.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.stringColumn is not None:
      oprot.writeFieldBegin('stringColumn', TTType.LIST, 7)
      oprot.writeListBegin(TTType.STRUCT, len(self.stringColumn))
      for iter80 in self.stringColumn:
        iter80.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TColumnValue(object):
  """
  Attributes:
   - boolVal
   - byteVal
   - i16Val
   - i32Val
   - i64Val
   - doubleVal
   - stringVal
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'boolVal', (TBoolValue, TBoolValue.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'byteVal', (TByteValue, TByteValue.thrift_spec), None, ), # 2
    (3, TTType.STRUCT, 'i16Val', (TI16Value, TI16Value.thrift_spec), None, ), # 3
    (4, TTType.STRUCT, 'i32Val', (TI32Value, TI32Value.thrift_spec), None, ), # 4
    (5, TTType.STRUCT, 'i64Val', (TI64Value, TI64Value.thrift_spec), None, ), # 5
    (6, TTType.STRUCT, 'doubleVal', (TDoubleValue, TDoubleValue.thrift_spec), None, ), # 6
    (7, TTType.STRUCT, 'stringVal', (TStringValue, TStringValue.thrift_spec), None, ), # 7
  )

  def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None,):
    self.boolVal = boolVal
    self.byteVal = byteVal
    self.i16Val = i16Val
    self.i32Val = i32Val
    self.i64Val = i64Val
    self.doubleVal = doubleVal
    self.stringVal = stringVal

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.boolVal = TBoolValue()
          self.boolVal.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.byteVal = TByteValue()
          self.byteVal.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRUCT:
          self.i16Val = TI16Value()
          self.i16Val.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.STRUCT:
          self.i32Val = TI32Value()
          self.i32Val.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TTType.STRUCT:
          self.i64Val = TI64Value()
          self.i64Val.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TTType.STRUCT:
          self.doubleVal = TDoubleValue()
          self.doubleVal.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TTType.STRUCT:
          self.stringVal = TStringValue()
          self.stringVal.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TColumnValue')
    if self.boolVal is not None:
      oprot.writeFieldBegin('boolVal', TTType.STRUCT, 1)
      self.boolVal.write(oprot)
      oprot.writeFieldEnd()
    if self.byteVal is not None:
      oprot.writeFieldBegin('byteVal', TTType.STRUCT, 2)
      self.byteVal.write(oprot)
      oprot.writeFieldEnd()
    if self.i16Val is not None:
      oprot.writeFieldBegin('i16Val', TTType.STRUCT, 3)
      self.i16Val.write(oprot)
      oprot.writeFieldEnd()
    if self.i32Val is not None:
      oprot.writeFieldBegin('i32Val', TTType.STRUCT, 4)
      self.i32Val.write(oprot)
      oprot.writeFieldEnd()
    if self.i64Val is not None:
      oprot.writeFieldBegin('i64Val', TTType.STRUCT, 5)
      self.i64Val.write(oprot)
      oprot.writeFieldEnd()
    if self.doubleVal is not None:
      oprot.writeFieldBegin('doubleVal', TTType.STRUCT, 6)
      self.doubleVal.write(oprot)
      oprot.writeFieldEnd()
    if self.stringVal is not None:
      oprot.writeFieldBegin('stringVal', TTType.STRUCT, 7)
      self.stringVal.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TRow(object):
  """
  Attributes:
   - colVals
  """

  thrift_spec = (
    None, # 0
    (1, TTType.LIST, 'colVals', (TTType.STRUCT,(TColumnValue, TColumnValue.thrift_spec)), None, ), # 1
  )

  def __init__(self, colVals=None,):
    self.colVals = colVals

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.LIST:
          self.colVals = []
          (_etype84, _size81) = iprot.readListBegin()
          for _i85 in xrange(_size81):
            _elem86 = TColumnValue()
            _elem86.read(iprot)
            self.colVals.append(_elem86)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TRow')
    if self.colVals is not None:
      oprot.writeFieldBegin('colVals', TTType.LIST, 1)
      oprot.writeListBegin(TTType.STRUCT, len(self.colVals))
      for iter87 in self.colVals:
        iter87.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.colVals is None:
      raise TProtocol.TProtocolException(message='Required field colVals is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TRowSet(object):
  """
  Attributes:
   - startRowOffset
   - rows
   - columns
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I64, 'startRowOffset', None, None, ), # 1
    (2, TTType.LIST, 'rows', (TTType.STRUCT,(TRow, TRow.thrift_spec)), None, ), # 2
    (3, TTType.LIST, 'columns', (TTType.STRUCT,(TColumn, TColumn.thrift_spec)), None, ), # 3
  )

  def __init__(self, startRowOffset=None, rows=None, columns=None,):
    self.startRowOffset = startRowOffset
    self.rows = rows
    self.columns = columns

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I64:
          self.startRowOffset = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.LIST:
          self.rows = []
          (_etype91, _size88) = iprot.readListBegin()
          for _i92 in xrange(_size88):
            _elem93 = TRow()
            _elem93.read(iprot)
            self.rows.append(_elem93)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.LIST:
          self.columns = []
          (_etype97, _size94) = iprot.readListBegin()
          for _i98 in xrange(_size94):
            _elem99 = TColumn()
            _elem99.read(iprot)
            self.columns.append(_elem99)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TRowSet')
    if self.startRowOffset is not None:
      oprot.writeFieldBegin('startRowOffset', TTType.I64, 1)
      oprot.writeI64(self.startRowOffset)
      oprot.writeFieldEnd()
    if self.rows is not None:
      oprot.writeFieldBegin('rows', TTType.LIST, 2)
      oprot.writeListBegin(TTType.STRUCT, len(self.rows))
      for iter100 in self.rows:
        iter100.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.columns is not None:
      oprot.writeFieldBegin('columns', TTType.LIST, 3)
      oprot.writeListBegin(TTType.STRUCT, len(self.columns))
      for iter101 in self.columns:
        iter101.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.startRowOffset is None:
      raise TProtocol.TProtocolException(message='Required field startRowOffset is unset!')
    if self.rows is None:
      raise TProtocol.TProtocolException(message='Required field rows is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TStatus(object):
  """
  Attributes:
   - statusCode
   - infoMessages
   - sqlState
   - errorCode
   - errorMessage
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I32, 'statusCode', None, None, ), # 1
    (2, TTType.LIST, 'infoMessages', (TTType.STRING,None), None, ), # 2
    (3, TTType.STRING, 'sqlState', None, None, ), # 3
    (4, TTType.I32, 'errorCode', None, None, ), # 4
    (5, TTType.STRING, 'errorMessage', None, None, ), # 5
  )

  def __init__(self, statusCode=None, infoMessages=None, sqlState=None, errorCode=None, errorMessage=None,):
    self.statusCode = statusCode
    self.infoMessages = infoMessages
    self.sqlState = sqlState
    self.errorCode = errorCode
    self.errorMessage = errorMessage

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I32:
          self.statusCode = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.LIST:
          self.infoMessages = []
          (_etype105, _size102) = iprot.readListBegin()
          for _i106 in xrange(_size102):
            _elem107 = iprot.readString();
            self.infoMessages.append(_elem107)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRING:
          self.sqlState = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.I32:
          self.errorCode = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TTType.STRING:
          self.errorMessage = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TStatus')
    if self.statusCode is not None:
      oprot.writeFieldBegin('statusCode', TTType.I32, 1)
      oprot.writeI32(self.statusCode)
      oprot.writeFieldEnd()
    if self.infoMessages is not None:
      oprot.writeFieldBegin('infoMessages', TTType.LIST, 2)
      oprot.writeListBegin(TTType.STRING, len(self.infoMessages))
      for iter108 in self.infoMessages:
        oprot.writeString(iter108)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.sqlState is not None:
      oprot.writeFieldBegin('sqlState', TTType.STRING, 3)
      oprot.writeString(self.sqlState)
      oprot.writeFieldEnd()
    if self.errorCode is not None:
      oprot.writeFieldBegin('errorCode', TTType.I32, 4)
      oprot.writeI32(self.errorCode)
      oprot.writeFieldEnd()
    if self.errorMessage is not None:
      oprot.writeFieldBegin('errorMessage', TTType.STRING, 5)
      oprot.writeString(self.errorMessage)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.statusCode is None:
      raise TProtocol.TProtocolException(message='Required field statusCode is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class THandleIdentifier(object):
  """
  Attributes:
   - guid
   - secret
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRING, 'guid', None, None, ), # 1
    (2, TTType.STRING, 'secret', None, None, ), # 2
  )

  def __init__(self, guid=None, secret=None,):
    self.guid = guid
    self.secret = secret

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRING:
          self.guid = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRING:
          self.secret = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('THandleIdentifier')
    if self.guid is not None:
      oprot.writeFieldBegin('guid', TTType.STRING, 1)
      oprot.writeString(self.guid)
      oprot.writeFieldEnd()
    if self.secret is not None:
      oprot.writeFieldBegin('secret', TTType.STRING, 2)
      oprot.writeString(self.secret)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.guid is None:
      raise TProtocol.TProtocolException(message='Required field guid is unset!')
    if self.secret is None:
      raise TProtocol.TProtocolException(message='Required field secret is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TSessionHandle(object):
  """
  Attributes:
   - sessionId
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionId', (THandleIdentifier, THandleIdentifier.thrift_spec), None, ), # 1
  )

  def __init__(self, sessionId=None,):
    self.sessionId = sessionId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionId = THandleIdentifier()
          self.sessionId.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TSessionHandle')
    if self.sessionId is not None:
      oprot.writeFieldBegin('sessionId', TTType.STRUCT, 1)
      self.sessionId.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionId is None:
      raise TProtocol.TProtocolException(message='Required field sessionId is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TOperationHandle(object):
  """
  Attributes:
   - operationId
   - operationType
   - hasResultSet
   - modifiedRowCount
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'operationId', (THandleIdentifier, THandleIdentifier.thrift_spec), None, ), # 1
    (2, TTType.I32, 'operationType', None, None, ), # 2
    (3, TTType.BOOL, 'hasResultSet', None, None, ), # 3
    (4, TTType.DOUBLE, 'modifiedRowCount', None, None, ), # 4
  )

  def __init__(self, operationId=None, operationType=None, hasResultSet=None, modifiedRowCount=None,):
    self.operationId = operationId
    self.operationType = operationType
    self.hasResultSet = hasResultSet
    self.modifiedRowCount = modifiedRowCount

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.operationId = THandleIdentifier()
          self.operationId.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.I32:
          self.operationType = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.BOOL:
          self.hasResultSet = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.DOUBLE:
          self.modifiedRowCount = iprot.readDouble();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TOperationHandle')
    if self.operationId is not None:
      oprot.writeFieldBegin('operationId', TTType.STRUCT, 1)
      self.operationId.write(oprot)
      oprot.writeFieldEnd()
    if self.operationType is not None:
      oprot.writeFieldBegin('operationType', TTType.I32, 2)
      oprot.writeI32(self.operationType)
      oprot.writeFieldEnd()
    if self.hasResultSet is not None:
      oprot.writeFieldBegin('hasResultSet', TTType.BOOL, 3)
      oprot.writeBool(self.hasResultSet)
      oprot.writeFieldEnd()
    if self.modifiedRowCount is not None:
      oprot.writeFieldBegin('modifiedRowCount', TTType.DOUBLE, 4)
      oprot.writeDouble(self.modifiedRowCount)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.operationId is None:
      raise TProtocol.TProtocolException(message='Required field operationId is unset!')
    if self.operationType is None:
      raise TProtocol.TProtocolException(message='Required field operationType is unset!')
    if self.hasResultSet is None:
      raise TProtocol.TProtocolException(message='Required field hasResultSet is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TOpenSessionReq(object):
  """
  Attributes:
   - client_protocol
   - username
   - password
   - configuration
  """

  thrift_spec = (
    None, # 0
    (1, TTType.I32, 'client_protocol', None,     0, ), # 1
    (2, TTType.STRING, 'username', None, None, ), # 2
    (3, TTType.STRING, 'password', None, None, ), # 3
    (4, TTType.MAP, 'configuration', (TTType.STRING,None,TTType.STRING,None), None, ), # 4
  )

  def __init__(self, client_protocol=thrift_spec[1][4], username=None, password=None, configuration=None,):
    self.client_protocol = client_protocol
    self.username = username
    self.password = password
    self.configuration = configuration

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.I32:
          self.client_protocol = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRING:
          self.username = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRING:
          self.password = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.MAP:
          self.configuration = {}
          (_ktype110, _vtype111, _size109 ) = iprot.readMapBegin() 
          for _i113 in xrange(_size109):
            _key114 = iprot.readString();
            _val115 = iprot.readString();
            self.configuration[_key114] = _val115
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TOpenSessionReq')
    if self.client_protocol is not None:
      oprot.writeFieldBegin('client_protocol', TTType.I32, 1)
      oprot.writeI32(self.client_protocol)
      oprot.writeFieldEnd()
    if self.username is not None:
      oprot.writeFieldBegin('username', TTType.STRING, 2)
      oprot.writeString(self.username)
      oprot.writeFieldEnd()
    if self.password is not None:
      oprot.writeFieldBegin('password', TTType.STRING, 3)
      oprot.writeString(self.password)
      oprot.writeFieldEnd()
    if self.configuration is not None:
      oprot.writeFieldBegin('configuration', TTType.MAP, 4)
      oprot.writeMapBegin(TTType.STRING, TTType.STRING, len(self.configuration))
      for kiter116,viter117 in self.configuration.items():
        oprot.writeString(kiter116)
        oprot.writeString(viter117)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.client_protocol is None:
      raise TProtocol.TProtocolException(message='Required field client_protocol is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TOpenSessionResp(object):
  """
  Attributes:
   - status
   - serverProtocolVersion
   - sessionHandle
   - configuration
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.I32, 'serverProtocolVersion', None,     0, ), # 2
    (3, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 3
    (4, TTType.MAP, 'configuration', (TTType.STRING,None,TTType.STRING,None), None, ), # 4
  )

  def __init__(self, status=None, serverProtocolVersion=thrift_spec[2][4], sessionHandle=None, configuration=None,):
    self.status = status
    self.serverProtocolVersion = serverProtocolVersion
    self.sessionHandle = sessionHandle
    self.configuration = configuration

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.I32:
          self.serverProtocolVersion = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.MAP:
          self.configuration = {}
          (_ktype119, _vtype120, _size118 ) = iprot.readMapBegin() 
          for _i122 in xrange(_size118):
            _key123 = iprot.readString();
            _val124 = iprot.readString();
            self.configuration[_key123] = _val124
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TOpenSessionResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.serverProtocolVersion is not None:
      oprot.writeFieldBegin('serverProtocolVersion', TTType.I32, 2)
      oprot.writeI32(self.serverProtocolVersion)
      oprot.writeFieldEnd()
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 3)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.configuration is not None:
      oprot.writeFieldBegin('configuration', TTType.MAP, 4)
      oprot.writeMapBegin(TTType.STRING, TTType.STRING, len(self.configuration))
      for kiter125,viter126 in self.configuration.items():
        oprot.writeString(kiter125)
        oprot.writeString(viter126)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    if self.serverProtocolVersion is None:
      raise TProtocol.TProtocolException(message='Required field serverProtocolVersion is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TCloseSessionReq(object):
  """
  Attributes:
   - sessionHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, sessionHandle=None,):
    self.sessionHandle = sessionHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TCloseSessionReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TCloseSessionResp(object):
  """
  Attributes:
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
  )

  def __init__(self, status=None,):
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TCloseSessionResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetInfoValue(object):
  """
  Attributes:
   - stringValue
   - smallIntValue
   - integerBitmask
   - integerFlag
   - binaryValue
   - lenValue
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRING, 'stringValue', None, None, ), # 1
    (2, TTType.I16, 'smallIntValue', None, None, ), # 2
    (3, TTType.I32, 'integerBitmask', None, None, ), # 3
    (4, TTType.I32, 'integerFlag', None, None, ), # 4
    (5, TTType.I32, 'binaryValue', None, None, ), # 5
    (6, TTType.I64, 'lenValue', None, None, ), # 6
  )

  def __init__(self, stringValue=None, smallIntValue=None, integerBitmask=None, integerFlag=None, binaryValue=None, lenValue=None,):
    self.stringValue = stringValue
    self.smallIntValue = smallIntValue
    self.integerBitmask = integerBitmask
    self.integerFlag = integerFlag
    self.binaryValue = binaryValue
    self.lenValue = lenValue

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRING:
          self.stringValue = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.I16:
          self.smallIntValue = iprot.readI16();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.I32:
          self.integerBitmask = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.I32:
          self.integerFlag = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TTType.I32:
          self.binaryValue = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TTType.I64:
          self.lenValue = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetInfoValue')
    if self.stringValue is not None:
      oprot.writeFieldBegin('stringValue', TTType.STRING, 1)
      oprot.writeString(self.stringValue)
      oprot.writeFieldEnd()
    if self.smallIntValue is not None:
      oprot.writeFieldBegin('smallIntValue', TTType.I16, 2)
      oprot.writeI16(self.smallIntValue)
      oprot.writeFieldEnd()
    if self.integerBitmask is not None:
      oprot.writeFieldBegin('integerBitmask', TTType.I32, 3)
      oprot.writeI32(self.integerBitmask)
      oprot.writeFieldEnd()
    if self.integerFlag is not None:
      oprot.writeFieldBegin('integerFlag', TTType.I32, 4)
      oprot.writeI32(self.integerFlag)
      oprot.writeFieldEnd()
    if self.binaryValue is not None:
      oprot.writeFieldBegin('binaryValue', TTType.I32, 5)
      oprot.writeI32(self.binaryValue)
      oprot.writeFieldEnd()
    if self.lenValue is not None:
      oprot.writeFieldBegin('lenValue', TTType.I64, 6)
      oprot.writeI64(self.lenValue)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetInfoReq(object):
  """
  Attributes:
   - sessionHandle
   - infoType
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
    (2, TTType.I32, 'infoType', None, None, ), # 2
  )

  def __init__(self, sessionHandle=None, infoType=None,):
    self.sessionHandle = sessionHandle
    self.infoType = infoType

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.I32:
          self.infoType = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetInfoReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.infoType is not None:
      oprot.writeFieldBegin('infoType', TTType.I32, 2)
      oprot.writeI32(self.infoType)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    if self.infoType is None:
      raise TProtocol.TProtocolException(message='Required field infoType is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetInfoResp(object):
  """
  Attributes:
   - status
   - infoValue
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'infoValue', (TGetInfoValue, TGetInfoValue.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, infoValue=None,):
    self.status = status
    self.infoValue = infoValue

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.infoValue = TGetInfoValue()
          self.infoValue.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetInfoResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.infoValue is not None:
      oprot.writeFieldBegin('infoValue', TTType.STRUCT, 2)
      self.infoValue.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    if self.infoValue is None:
      raise TProtocol.TProtocolException(message='Required field infoValue is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TExecuteStatementReq(object):
  """
  Attributes:
   - sessionHandle
   - statement
   - confOverlay
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
    (2, TTType.STRING, 'statement', None, None, ), # 2
    (3, TTType.MAP, 'confOverlay', (TTType.STRING,None,TTType.STRING,None), None, ), # 3
  )

  def __init__(self, sessionHandle=None, statement=None, confOverlay=None,):
    self.sessionHandle = sessionHandle
    self.statement = statement
    self.confOverlay = confOverlay

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRING:
          self.statement = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.MAP:
          self.confOverlay = {}
          (_ktype128, _vtype129, _size127 ) = iprot.readMapBegin() 
          for _i131 in xrange(_size127):
            _key132 = iprot.readString();
            _val133 = iprot.readString();
            self.confOverlay[_key132] = _val133
          iprot.readMapEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TExecuteStatementReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.statement is not None:
      oprot.writeFieldBegin('statement', TTType.STRING, 2)
      oprot.writeString(self.statement)
      oprot.writeFieldEnd()
    if self.confOverlay is not None:
      oprot.writeFieldBegin('confOverlay', TTType.MAP, 3)
      oprot.writeMapBegin(TTType.STRING, TTType.STRING, len(self.confOverlay))
      for kiter134,viter135 in self.confOverlay.items():
        oprot.writeString(kiter134)
        oprot.writeString(viter135)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    if self.statement is None:
      raise TProtocol.TProtocolException(message='Required field statement is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TExecuteStatementResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TExecuteStatementResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetTypeInfoReq(object):
  """
  Attributes:
   - sessionHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, sessionHandle=None,):
    self.sessionHandle = sessionHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetTypeInfoReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetTypeInfoResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetTypeInfoResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetCatalogsReq(object):
  """
  Attributes:
   - sessionHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, sessionHandle=None,):
    self.sessionHandle = sessionHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetCatalogsReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetCatalogsResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetCatalogsResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetSchemasReq(object):
  """
  Attributes:
   - sessionHandle
   - catalogName
   - schemaName
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
    (2, TTType.STRING, 'catalogName', None, None, ), # 2
    (3, TTType.STRING, 'schemaName', None, None, ), # 3
  )

  def __init__(self, sessionHandle=None, catalogName=None, schemaName=None,):
    self.sessionHandle = sessionHandle
    self.catalogName = catalogName
    self.schemaName = schemaName

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRING:
          self.catalogName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRING:
          self.schemaName = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetSchemasReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.catalogName is not None:
      oprot.writeFieldBegin('catalogName', TTType.STRING, 2)
      oprot.writeString(self.catalogName)
      oprot.writeFieldEnd()
    if self.schemaName is not None:
      oprot.writeFieldBegin('schemaName', TTType.STRING, 3)
      oprot.writeString(self.schemaName)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetSchemasResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetSchemasResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetTablesReq(object):
  """
  Attributes:
   - sessionHandle
   - catalogName
   - schemaName
   - tableName
   - tableTypes
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
    (2, TTType.STRING, 'catalogName', None, None, ), # 2
    (3, TTType.STRING, 'schemaName', None, None, ), # 3
    (4, TTType.STRING, 'tableName', None, None, ), # 4
    (5, TTType.LIST, 'tableTypes', (TTType.STRING,None), None, ), # 5
  )

  def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None, tableTypes=None,):
    self.sessionHandle = sessionHandle
    self.catalogName = catalogName
    self.schemaName = schemaName
    self.tableName = tableName
    self.tableTypes = tableTypes

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRING:
          self.catalogName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRING:
          self.schemaName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.STRING:
          self.tableName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TTType.LIST:
          self.tableTypes = []
          (_etype139, _size136) = iprot.readListBegin()
          for _i140 in xrange(_size136):
            _elem141 = iprot.readString();
            self.tableTypes.append(_elem141)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetTablesReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.catalogName is not None:
      oprot.writeFieldBegin('catalogName', TTType.STRING, 2)
      oprot.writeString(self.catalogName)
      oprot.writeFieldEnd()
    if self.schemaName is not None:
      oprot.writeFieldBegin('schemaName', TTType.STRING, 3)
      oprot.writeString(self.schemaName)
      oprot.writeFieldEnd()
    if self.tableName is not None:
      oprot.writeFieldBegin('tableName', TTType.STRING, 4)
      oprot.writeString(self.tableName)
      oprot.writeFieldEnd()
    if self.tableTypes is not None:
      oprot.writeFieldBegin('tableTypes', TTType.LIST, 5)
      oprot.writeListBegin(TTType.STRING, len(self.tableTypes))
      for iter142 in self.tableTypes:
        oprot.writeString(iter142)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetTablesResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetTablesResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetTableTypesReq(object):
  """
  Attributes:
   - sessionHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, sessionHandle=None,):
    self.sessionHandle = sessionHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetTableTypesReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetTableTypesResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetTableTypesResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetColumnsReq(object):
  """
  Attributes:
   - sessionHandle
   - catalogName
   - schemaName
   - tableName
   - columnName
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
    (2, TTType.STRING, 'catalogName', None, None, ), # 2
    (3, TTType.STRING, 'schemaName', None, None, ), # 3
    (4, TTType.STRING, 'tableName', None, None, ), # 4
    (5, TTType.STRING, 'columnName', None, None, ), # 5
  )

  def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None, columnName=None,):
    self.sessionHandle = sessionHandle
    self.catalogName = catalogName
    self.schemaName = schemaName
    self.tableName = tableName
    self.columnName = columnName

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRING:
          self.catalogName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRING:
          self.schemaName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.STRING:
          self.tableName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TTType.STRING:
          self.columnName = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetColumnsReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.catalogName is not None:
      oprot.writeFieldBegin('catalogName', TTType.STRING, 2)
      oprot.writeString(self.catalogName)
      oprot.writeFieldEnd()
    if self.schemaName is not None:
      oprot.writeFieldBegin('schemaName', TTType.STRING, 3)
      oprot.writeString(self.schemaName)
      oprot.writeFieldEnd()
    if self.tableName is not None:
      oprot.writeFieldBegin('tableName', TTType.STRING, 4)
      oprot.writeString(self.tableName)
      oprot.writeFieldEnd()
    if self.columnName is not None:
      oprot.writeFieldBegin('columnName', TTType.STRING, 5)
      oprot.writeString(self.columnName)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetColumnsResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetColumnsResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetFunctionsReq(object):
  """
  Attributes:
   - sessionHandle
   - catalogName
   - schemaName
   - functionName
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 1
    (2, TTType.STRING, 'catalogName', None, None, ), # 2
    (3, TTType.STRING, 'schemaName', None, None, ), # 3
    (4, TTType.STRING, 'functionName', None, None, ), # 4
  )

  def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, functionName=None,):
    self.sessionHandle = sessionHandle
    self.catalogName = catalogName
    self.schemaName = schemaName
    self.functionName = functionName

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.sessionHandle = TSessionHandle()
          self.sessionHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRING:
          self.catalogName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRING:
          self.schemaName = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TTType.STRING:
          self.functionName = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetFunctionsReq')
    if self.sessionHandle is not None:
      oprot.writeFieldBegin('sessionHandle', TTType.STRUCT, 1)
      self.sessionHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.catalogName is not None:
      oprot.writeFieldBegin('catalogName', TTType.STRING, 2)
      oprot.writeString(self.catalogName)
      oprot.writeFieldEnd()
    if self.schemaName is not None:
      oprot.writeFieldBegin('schemaName', TTType.STRING, 3)
      oprot.writeString(self.schemaName)
      oprot.writeFieldEnd()
    if self.functionName is not None:
      oprot.writeFieldBegin('functionName', TTType.STRING, 4)
      oprot.writeString(self.functionName)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.sessionHandle is None:
      raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!')
    if self.functionName is None:
      raise TProtocol.TProtocolException(message='Required field functionName is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetFunctionsResp(object):
  """
  Attributes:
   - status
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, operationHandle=None,):
    self.status = status
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetFunctionsResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 2)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetOperationStatusReq(object):
  """
  Attributes:
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, operationHandle=None,):
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetOperationStatusReq')
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 1)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.operationHandle is None:
      raise TProtocol.TProtocolException(message='Required field operationHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetOperationStatusResp(object):
  """
  Attributes:
   - status
   - operationState
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.I32, 'operationState', None, None, ), # 2
  )

  def __init__(self, status=None, operationState=None,):
    self.status = status
    self.operationState = operationState

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.I32:
          self.operationState = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetOperationStatusResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.operationState is not None:
      oprot.writeFieldBegin('operationState', TTType.I32, 2)
      oprot.writeI32(self.operationState)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TCancelOperationReq(object):
  """
  Attributes:
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, operationHandle=None,):
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TCancelOperationReq')
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 1)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.operationHandle is None:
      raise TProtocol.TProtocolException(message='Required field operationHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TCancelOperationResp(object):
  """
  Attributes:
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
  )

  def __init__(self, status=None,):
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TCancelOperationResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TCloseOperationReq(object):
  """
  Attributes:
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, operationHandle=None,):
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TCloseOperationReq')
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 1)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.operationHandle is None:
      raise TProtocol.TProtocolException(message='Required field operationHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TCloseOperationResp(object):
  """
  Attributes:
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
  )

  def __init__(self, status=None,):
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TCloseOperationResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetResultSetMetadataReq(object):
  """
  Attributes:
   - operationHandle
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 1
  )

  def __init__(self, operationHandle=None,):
    self.operationHandle = operationHandle

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetResultSetMetadataReq')
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 1)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.operationHandle is None:
      raise TProtocol.TProtocolException(message='Required field operationHandle is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TGetResultSetMetadataResp(object):
  """
  Attributes:
   - status
   - schema
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.STRUCT, 'schema', (TTableSchema, TTableSchema.thrift_spec), None, ), # 2
  )

  def __init__(self, status=None, schema=None,):
    self.status = status
    self.schema = schema

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.STRUCT:
          self.schema = TTableSchema()
          self.schema.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TGetResultSetMetadataResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.schema is not None:
      oprot.writeFieldBegin('schema', TTType.STRUCT, 2)
      self.schema.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TFetchResultsReq(object):
  """
  Attributes:
   - operationHandle
   - orientation
   - maxRows
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 1
    (2, TTType.I32, 'orientation', None,     0, ), # 2
    (3, TTType.I64, 'maxRows', None, None, ), # 3
  )

  def __init__(self, operationHandle=None, orientation=thrift_spec[2][4], maxRows=None,):
    self.operationHandle = operationHandle
    self.orientation = orientation
    self.maxRows = maxRows

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.operationHandle = TOperationHandle()
          self.operationHandle.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.I32:
          self.orientation = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.I64:
          self.maxRows = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TFetchResultsReq')
    if self.operationHandle is not None:
      oprot.writeFieldBegin('operationHandle', TTType.STRUCT, 1)
      self.operationHandle.write(oprot)
      oprot.writeFieldEnd()
    if self.orientation is not None:
      oprot.writeFieldBegin('orientation', TTType.I32, 2)
      oprot.writeI32(self.orientation)
      oprot.writeFieldEnd()
    if self.maxRows is not None:
      oprot.writeFieldBegin('maxRows', TTType.I64, 3)
      oprot.writeI64(self.maxRows)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.operationHandle is None:
      raise TProtocol.TProtocolException(message='Required field operationHandle is unset!')
    if self.orientation is None:
      raise TProtocol.TProtocolException(message='Required field orientation is unset!')
    if self.maxRows is None:
      raise TProtocol.TProtocolException(message='Required field maxRows is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TFetchResultsResp(object):
  """
  Attributes:
   - status
   - hasMoreRows
   - results
  """

  thrift_spec = (
    None, # 0
    (1, TTType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
    (2, TTType.BOOL, 'hasMoreRows', None, None, ), # 2
    (3, TTType.STRUCT, 'results', (TRowSet, TRowSet.thrift_spec), None, ), # 3
  )

  def __init__(self, status=None, hasMoreRows=None, results=None,):
    self.status = status
    self.hasMoreRows = hasMoreRows
    self.results = results

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TTType.STOP:
        break
      if fid == 1:
        if ftype == TTType.STRUCT:
          self.status = TStatus()
          self.status.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TTType.BOOL:
          self.hasMoreRows = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TTType.STRUCT:
          self.results = TRowSet()
          self.results.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TFetchResultsResp')
    if self.status is not None:
      oprot.writeFieldBegin('status', TTType.STRUCT, 1)
      self.status.write(oprot)
      oprot.writeFieldEnd()
    if self.hasMoreRows is not None:
      oprot.writeFieldBegin('hasMoreRows', TTType.BOOL, 2)
      oprot.writeBool(self.hasMoreRows)
      oprot.writeFieldEnd()
    if self.results is not None:
      oprot.writeFieldBegin('results', TTType.STRUCT, 3)
      self.results.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.status is None:
      raise TProtocol.TProtocolException(message='Required field status is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)
