#
# Autogenerated by Thrift Compiler (0.14.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec

import sys

from thrift.transport import TTransport
all_structs = []


class TSProtocolVersion(object):
    IOTDB_SERVICE_PROTOCOL_V1 = 0
    IOTDB_SERVICE_PROTOCOL_V2 = 1
    IOTDB_SERVICE_PROTOCOL_V3 = 2

    _VALUES_TO_NAMES = {
        0: "IOTDB_SERVICE_PROTOCOL_V1",
        1: "IOTDB_SERVICE_PROTOCOL_V2",
        2: "IOTDB_SERVICE_PROTOCOL_V3",
    }

    _NAMES_TO_VALUES = {
        "IOTDB_SERVICE_PROTOCOL_V1": 0,
        "IOTDB_SERVICE_PROTOCOL_V2": 1,
        "IOTDB_SERVICE_PROTOCOL_V3": 2,
    }


class TSConnectionType(object):
    THRIFT_BASED = 0
    MQTT_BASED = 1

    _VALUES_TO_NAMES = {
        0: "THRIFT_BASED",
        1: "MQTT_BASED",
    }

    _NAMES_TO_VALUES = {
        "THRIFT_BASED": 0,
        "MQTT_BASED": 1,
    }


class EndPoint(object):
    """
    Attributes:
     - ip
     - port

    """


    def __init__(self, ip=None, port=None,):
        self.ip = ip
        self.port = port

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.ip = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.port = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('EndPoint')
        if self.ip is not None:
            oprot.writeFieldBegin('ip', TType.STRING, 1)
            oprot.writeString(self.ip.encode('utf-8') if sys.version_info[0] == 2 else self.ip)
            oprot.writeFieldEnd()
        if self.port is not None:
            oprot.writeFieldBegin('port', TType.I32, 2)
            oprot.writeI32(self.port)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSStatus(object):
    """
    Attributes:
     - code
     - message
     - subStatus
     - redirectNode

    """


    def __init__(self, code=None, message=None, subStatus=None, redirectNode=None,):
        self.code = code
        self.message = message
        self.subStatus = subStatus
        self.redirectNode = redirectNode

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.code = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.message = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.subStatus = []
                    (_etype3, _size0) = iprot.readListBegin()
                    for _i4 in range(_size0):
                        _elem5 = TSStatus()
                        _elem5.read(iprot)
                        self.subStatus.append(_elem5)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.redirectNode = EndPoint()
                    self.redirectNode.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSStatus')
        if self.code is not None:
            oprot.writeFieldBegin('code', TType.I32, 1)
            oprot.writeI32(self.code)
            oprot.writeFieldEnd()
        if self.message is not None:
            oprot.writeFieldBegin('message', TType.STRING, 2)
            oprot.writeString(self.message.encode('utf-8') if sys.version_info[0] == 2 else self.message)
            oprot.writeFieldEnd()
        if self.subStatus is not None:
            oprot.writeFieldBegin('subStatus', TType.LIST, 3)
            oprot.writeListBegin(TType.STRUCT, len(self.subStatus))
            for iter6 in self.subStatus:
                iter6.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.redirectNode is not None:
            oprot.writeFieldBegin('redirectNode', TType.STRUCT, 4)
            self.redirectNode.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSQueryDataSet(object):
    """
    Attributes:
     - time
     - valueList
     - bitmapList

    """


    def __init__(self, time=None, valueList=None, bitmapList=None,):
        self.time = time
        self.valueList = valueList
        self.bitmapList = bitmapList

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.time = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.valueList = []
                    (_etype10, _size7) = iprot.readListBegin()
                    for _i11 in range(_size7):
                        _elem12 = iprot.readBinary()
                        self.valueList.append(_elem12)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.bitmapList = []
                    (_etype16, _size13) = iprot.readListBegin()
                    for _i17 in range(_size13):
                        _elem18 = iprot.readBinary()
                        self.bitmapList.append(_elem18)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSQueryDataSet')
        if self.time is not None:
            oprot.writeFieldBegin('time', TType.STRING, 1)
            oprot.writeBinary(self.time)
            oprot.writeFieldEnd()
        if self.valueList is not None:
            oprot.writeFieldBegin('valueList', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.valueList))
            for iter19 in self.valueList:
                oprot.writeBinary(iter19)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.bitmapList is not None:
            oprot.writeFieldBegin('bitmapList', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.bitmapList))
            for iter20 in self.bitmapList:
                oprot.writeBinary(iter20)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSQueryNonAlignDataSet(object):
    """
    Attributes:
     - timeList
     - valueList

    """


    def __init__(self, timeList=None, valueList=None,):
        self.timeList = timeList
        self.valueList = valueList

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.LIST:
                    self.timeList = []
                    (_etype24, _size21) = iprot.readListBegin()
                    for _i25 in range(_size21):
                        _elem26 = iprot.readBinary()
                        self.timeList.append(_elem26)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.valueList = []
                    (_etype30, _size27) = iprot.readListBegin()
                    for _i31 in range(_size27):
                        _elem32 = iprot.readBinary()
                        self.valueList.append(_elem32)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSQueryNonAlignDataSet')
        if self.timeList is not None:
            oprot.writeFieldBegin('timeList', TType.LIST, 1)
            oprot.writeListBegin(TType.STRING, len(self.timeList))
            for iter33 in self.timeList:
                oprot.writeBinary(iter33)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.valueList is not None:
            oprot.writeFieldBegin('valueList', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.valueList))
            for iter34 in self.valueList:
                oprot.writeBinary(iter34)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSTracingInfo(object):
    """
    Attributes:
     - activityList
     - elapsedTimeList
     - seriesPathNum
     - seqFileNum
     - unSeqFileNum
     - sequenceChunkNum
     - sequenceChunkPointNum
     - unsequenceChunkNum
     - unsequenceChunkPointNum
     - totalPageNum
     - overlappedPageNum

    """


    def __init__(self, activityList=None, elapsedTimeList=None, seriesPathNum=None, seqFileNum=None, unSeqFileNum=None, sequenceChunkNum=None, sequenceChunkPointNum=None, unsequenceChunkNum=None, unsequenceChunkPointNum=None, totalPageNum=None, overlappedPageNum=None,):
        self.activityList = activityList
        self.elapsedTimeList = elapsedTimeList
        self.seriesPathNum = seriesPathNum
        self.seqFileNum = seqFileNum
        self.unSeqFileNum = unSeqFileNum
        self.sequenceChunkNum = sequenceChunkNum
        self.sequenceChunkPointNum = sequenceChunkPointNum
        self.unsequenceChunkNum = unsequenceChunkNum
        self.unsequenceChunkPointNum = unsequenceChunkPointNum
        self.totalPageNum = totalPageNum
        self.overlappedPageNum = overlappedPageNum

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.LIST:
                    self.activityList = []
                    (_etype38, _size35) = iprot.readListBegin()
                    for _i39 in range(_size35):
                        _elem40 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.activityList.append(_elem40)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.elapsedTimeList = []
                    (_etype44, _size41) = iprot.readListBegin()
                    for _i45 in range(_size41):
                        _elem46 = iprot.readI64()
                        self.elapsedTimeList.append(_elem46)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.seriesPathNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.seqFileNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I32:
                    self.unSeqFileNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I32:
                    self.sequenceChunkNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I64:
                    self.sequenceChunkPointNum = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I32:
                    self.unsequenceChunkNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I64:
                    self.unsequenceChunkPointNum = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.I32:
                    self.totalPageNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.I32:
                    self.overlappedPageNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSTracingInfo')
        if self.activityList is not None:
            oprot.writeFieldBegin('activityList', TType.LIST, 1)
            oprot.writeListBegin(TType.STRING, len(self.activityList))
            for iter47 in self.activityList:
                oprot.writeString(iter47.encode('utf-8') if sys.version_info[0] == 2 else iter47)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.elapsedTimeList is not None:
            oprot.writeFieldBegin('elapsedTimeList', TType.LIST, 2)
            oprot.writeListBegin(TType.I64, len(self.elapsedTimeList))
            for iter48 in self.elapsedTimeList:
                oprot.writeI64(iter48)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.seriesPathNum is not None:
            oprot.writeFieldBegin('seriesPathNum', TType.I32, 3)
            oprot.writeI32(self.seriesPathNum)
            oprot.writeFieldEnd()
        if self.seqFileNum is not None:
            oprot.writeFieldBegin('seqFileNum', TType.I32, 4)
            oprot.writeI32(self.seqFileNum)
            oprot.writeFieldEnd()
        if self.unSeqFileNum is not None:
            oprot.writeFieldBegin('unSeqFileNum', TType.I32, 5)
            oprot.writeI32(self.unSeqFileNum)
            oprot.writeFieldEnd()
        if self.sequenceChunkNum is not None:
            oprot.writeFieldBegin('sequenceChunkNum', TType.I32, 6)
            oprot.writeI32(self.sequenceChunkNum)
            oprot.writeFieldEnd()
        if self.sequenceChunkPointNum is not None:
            oprot.writeFieldBegin('sequenceChunkPointNum', TType.I64, 7)
            oprot.writeI64(self.sequenceChunkPointNum)
            oprot.writeFieldEnd()
        if self.unsequenceChunkNum is not None:
            oprot.writeFieldBegin('unsequenceChunkNum', TType.I32, 8)
            oprot.writeI32(self.unsequenceChunkNum)
            oprot.writeFieldEnd()
        if self.unsequenceChunkPointNum is not None:
            oprot.writeFieldBegin('unsequenceChunkPointNum', TType.I64, 9)
            oprot.writeI64(self.unsequenceChunkPointNum)
            oprot.writeFieldEnd()
        if self.totalPageNum is not None:
            oprot.writeFieldBegin('totalPageNum', TType.I32, 10)
            oprot.writeI32(self.totalPageNum)
            oprot.writeFieldEnd()
        if self.overlappedPageNum is not None:
            oprot.writeFieldBegin('overlappedPageNum', TType.I32, 11)
            oprot.writeI32(self.overlappedPageNum)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSExecuteStatementResp(object):
    """
    Attributes:
     - status
     - queryId
     - columns
     - operationType
     - ignoreTimeStamp
     - dataTypeList
     - queryDataSet
     - nonAlignQueryDataSet
     - columnNameIndexMap
     - sgColumns
     - aliasColumns
     - tracingInfo

    """


    def __init__(self, status=None, queryId=None, columns=None, operationType=None, ignoreTimeStamp=None, dataTypeList=None, queryDataSet=None, nonAlignQueryDataSet=None, columnNameIndexMap=None, sgColumns=None, aliasColumns=None, tracingInfo=None,):
        self.status = status
        self.queryId = queryId
        self.columns = columns
        self.operationType = operationType
        self.ignoreTimeStamp = ignoreTimeStamp
        self.dataTypeList = dataTypeList
        self.queryDataSet = queryDataSet
        self.nonAlignQueryDataSet = nonAlignQueryDataSet
        self.columnNameIndexMap = columnNameIndexMap
        self.sgColumns = sgColumns
        self.aliasColumns = aliasColumns
        self.tracingInfo = tracingInfo

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.queryId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.columns = []
                    (_etype52, _size49) = iprot.readListBegin()
                    for _i53 in range(_size49):
                        _elem54 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.columns.append(_elem54)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.operationType = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.ignoreTimeStamp = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.LIST:
                    self.dataTypeList = []
                    (_etype58, _size55) = iprot.readListBegin()
                    for _i59 in range(_size55):
                        _elem60 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.dataTypeList.append(_elem60)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRUCT:
                    self.queryDataSet = TSQueryDataSet()
                    self.queryDataSet.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.STRUCT:
                    self.nonAlignQueryDataSet = TSQueryNonAlignDataSet()
                    self.nonAlignQueryDataSet.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.MAP:
                    self.columnNameIndexMap = {}
                    (_ktype62, _vtype63, _size61) = iprot.readMapBegin()
                    for _i65 in range(_size61):
                        _key66 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        _val67 = iprot.readI32()
                        self.columnNameIndexMap[_key66] = _val67
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.LIST:
                    self.sgColumns = []
                    (_etype71, _size68) = iprot.readListBegin()
                    for _i72 in range(_size68):
                        _elem73 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.sgColumns.append(_elem73)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 11:
                if ftype == TType.LIST:
                    self.aliasColumns = []
                    (_etype77, _size74) = iprot.readListBegin()
                    for _i78 in range(_size74):
                        _elem79 = iprot.readByte()
                        self.aliasColumns.append(_elem79)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 12:
                if ftype == TType.STRUCT:
                    self.tracingInfo = TSTracingInfo()
                    self.tracingInfo.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSExecuteStatementResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.queryId is not None:
            oprot.writeFieldBegin('queryId', TType.I64, 2)
            oprot.writeI64(self.queryId)
            oprot.writeFieldEnd()
        if self.columns is not None:
            oprot.writeFieldBegin('columns', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.columns))
            for iter80 in self.columns:
                oprot.writeString(iter80.encode('utf-8') if sys.version_info[0] == 2 else iter80)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.operationType is not None:
            oprot.writeFieldBegin('operationType', TType.STRING, 4)
            oprot.writeString(self.operationType.encode('utf-8') if sys.version_info[0] == 2 else self.operationType)
            oprot.writeFieldEnd()
        if self.ignoreTimeStamp is not None:
            oprot.writeFieldBegin('ignoreTimeStamp', TType.BOOL, 5)
            oprot.writeBool(self.ignoreTimeStamp)
            oprot.writeFieldEnd()
        if self.dataTypeList is not None:
            oprot.writeFieldBegin('dataTypeList', TType.LIST, 6)
            oprot.writeListBegin(TType.STRING, len(self.dataTypeList))
            for iter81 in self.dataTypeList:
                oprot.writeString(iter81.encode('utf-8') if sys.version_info[0] == 2 else iter81)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.queryDataSet is not None:
            oprot.writeFieldBegin('queryDataSet', TType.STRUCT, 7)
            self.queryDataSet.write(oprot)
            oprot.writeFieldEnd()
        if self.nonAlignQueryDataSet is not None:
            oprot.writeFieldBegin('nonAlignQueryDataSet', TType.STRUCT, 8)
            self.nonAlignQueryDataSet.write(oprot)
            oprot.writeFieldEnd()
        if self.columnNameIndexMap is not None:
            oprot.writeFieldBegin('columnNameIndexMap', TType.MAP, 9)
            oprot.writeMapBegin(TType.STRING, TType.I32, len(self.columnNameIndexMap))
            for kiter82, viter83 in self.columnNameIndexMap.items():
                oprot.writeString(kiter82.encode('utf-8') if sys.version_info[0] == 2 else kiter82)
                oprot.writeI32(viter83)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.sgColumns is not None:
            oprot.writeFieldBegin('sgColumns', TType.LIST, 10)
            oprot.writeListBegin(TType.STRING, len(self.sgColumns))
            for iter84 in self.sgColumns:
                oprot.writeString(iter84.encode('utf-8') if sys.version_info[0] == 2 else iter84)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.aliasColumns is not None:
            oprot.writeFieldBegin('aliasColumns', TType.LIST, 11)
            oprot.writeListBegin(TType.BYTE, len(self.aliasColumns))
            for iter85 in self.aliasColumns:
                oprot.writeByte(iter85)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.tracingInfo is not None:
            oprot.writeFieldBegin('tracingInfo', TType.STRUCT, 12)
            self.tracingInfo.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSOpenSessionResp(object):
    """
    Attributes:
     - status
     - serverProtocolVersion
     - sessionId
     - configuration

    """


    def __init__(self, status=None, serverProtocolVersion=0, sessionId=None, configuration=None,):
        self.status = status
        self.serverProtocolVersion = serverProtocolVersion
        self.sessionId = sessionId
        self.configuration = configuration

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.serverProtocolVersion = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.configuration = {}
                    (_ktype87, _vtype88, _size86) = iprot.readMapBegin()
                    for _i90 in range(_size86):
                        _key91 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        _val92 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.configuration[_key91] = _val92
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSOpenSessionResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.serverProtocolVersion is not None:
            oprot.writeFieldBegin('serverProtocolVersion', TType.I32, 2)
            oprot.writeI32(self.serverProtocolVersion)
            oprot.writeFieldEnd()
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 3)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.configuration is not None:
            oprot.writeFieldBegin('configuration', TType.MAP, 4)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration))
            for kiter93, viter94 in self.configuration.items():
                oprot.writeString(kiter93.encode('utf-8') if sys.version_info[0] == 2 else kiter93)
                oprot.writeString(viter94.encode('utf-8') if sys.version_info[0] == 2 else viter94)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSOpenSessionReq(object):
    """
    Attributes:
     - client_protocol
     - zoneId
     - username
     - password
     - configuration

    """


    def __init__(self, client_protocol=2, zoneId=None, username=None, password=None, configuration=None,):
        self.client_protocol = client_protocol
        self.zoneId = zoneId
        self.username = username
        self.password = password
        self.configuration = configuration

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.client_protocol = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.zoneId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.username = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.password = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.MAP:
                    self.configuration = {}
                    (_ktype96, _vtype97, _size95) = iprot.readMapBegin()
                    for _i99 in range(_size95):
                        _key100 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        _val101 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.configuration[_key100] = _val101
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSOpenSessionReq')
        if self.client_protocol is not None:
            oprot.writeFieldBegin('client_protocol', TType.I32, 1)
            oprot.writeI32(self.client_protocol)
            oprot.writeFieldEnd()
        if self.zoneId is not None:
            oprot.writeFieldBegin('zoneId', TType.STRING, 2)
            oprot.writeString(self.zoneId.encode('utf-8') if sys.version_info[0] == 2 else self.zoneId)
            oprot.writeFieldEnd()
        if self.username is not None:
            oprot.writeFieldBegin('username', TType.STRING, 3)
            oprot.writeString(self.username.encode('utf-8') if sys.version_info[0] == 2 else self.username)
            oprot.writeFieldEnd()
        if self.password is not None:
            oprot.writeFieldBegin('password', TType.STRING, 4)
            oprot.writeString(self.password.encode('utf-8') if sys.version_info[0] == 2 else self.password)
            oprot.writeFieldEnd()
        if self.configuration is not None:
            oprot.writeFieldBegin('configuration', TType.MAP, 5)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration))
            for kiter102, viter103 in self.configuration.items():
                oprot.writeString(kiter102.encode('utf-8') if sys.version_info[0] == 2 else kiter102)
                oprot.writeString(viter103.encode('utf-8') if sys.version_info[0] == 2 else viter103)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSCloseSessionReq(object):
    """
    Attributes:
     - sessionId

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSCloseSessionReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSExecuteStatementReq(object):
    """
    Attributes:
     - sessionId
     - statement
     - statementId
     - fetchSize
     - timeout
     - enableRedirectQuery
     - jdbcQuery

    """


    def __init__(self, sessionId=None, statement=None, statementId=None, fetchSize=None, timeout=None, enableRedirectQuery=None, jdbcQuery=None,):
        self.sessionId = sessionId
        self.statement = statement
        self.statementId = statementId
        self.fetchSize = fetchSize
        self.timeout = timeout
        self.enableRedirectQuery = enableRedirectQuery
        self.jdbcQuery = jdbcQuery

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.statement = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.statementId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.fetchSize = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.timeout = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.enableRedirectQuery = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.BOOL:
                    self.jdbcQuery = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSExecuteStatementReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.statement is not None:
            oprot.writeFieldBegin('statement', TType.STRING, 2)
            oprot.writeString(self.statement.encode('utf-8') if sys.version_info[0] == 2 else self.statement)
            oprot.writeFieldEnd()
        if self.statementId is not None:
            oprot.writeFieldBegin('statementId', TType.I64, 3)
            oprot.writeI64(self.statementId)
            oprot.writeFieldEnd()
        if self.fetchSize is not None:
            oprot.writeFieldBegin('fetchSize', TType.I32, 4)
            oprot.writeI32(self.fetchSize)
            oprot.writeFieldEnd()
        if self.timeout is not None:
            oprot.writeFieldBegin('timeout', TType.I64, 5)
            oprot.writeI64(self.timeout)
            oprot.writeFieldEnd()
        if self.enableRedirectQuery is not None:
            oprot.writeFieldBegin('enableRedirectQuery', TType.BOOL, 6)
            oprot.writeBool(self.enableRedirectQuery)
            oprot.writeFieldEnd()
        if self.jdbcQuery is not None:
            oprot.writeFieldBegin('jdbcQuery', TType.BOOL, 7)
            oprot.writeBool(self.jdbcQuery)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSExecuteBatchStatementReq(object):
    """
    Attributes:
     - sessionId
     - statements

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.statements = []
                    (_etype107, _size104) = iprot.readListBegin()
                    for _i108 in range(_size104):
                        _elem109 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.statements.append(_elem109)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSExecuteBatchStatementReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.statements is not None:
            oprot.writeFieldBegin('statements', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.statements))
            for iter110 in self.statements:
                oprot.writeString(iter110.encode('utf-8') if sys.version_info[0] == 2 else iter110)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSGetOperationStatusReq(object):
    """
    Attributes:
     - sessionId
     - queryId

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.queryId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSGetOperationStatusReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.queryId is not None:
            oprot.writeFieldBegin('queryId', TType.I64, 2)
            oprot.writeI64(self.queryId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSCancelOperationReq(object):
    """
    Attributes:
     - sessionId
     - queryId

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.queryId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSCancelOperationReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.queryId is not None:
            oprot.writeFieldBegin('queryId', TType.I64, 2)
            oprot.writeI64(self.queryId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSCloseOperationReq(object):
    """
    Attributes:
     - sessionId
     - queryId
     - statementId

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.queryId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.statementId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSCloseOperationReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.queryId is not None:
            oprot.writeFieldBegin('queryId', TType.I64, 2)
            oprot.writeI64(self.queryId)
            oprot.writeFieldEnd()
        if self.statementId is not None:
            oprot.writeFieldBegin('statementId', TType.I64, 3)
            oprot.writeI64(self.statementId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSFetchResultsReq(object):
    """
    Attributes:
     - sessionId
     - statement
     - fetchSize
     - queryId
     - isAlign
     - timeout

    """


    def __init__(self, sessionId=None, statement=None, fetchSize=None, queryId=None, isAlign=None, timeout=None,):
        self.sessionId = sessionId
        self.statement = statement
        self.fetchSize = fetchSize
        self.queryId = queryId
        self.isAlign = isAlign
        self.timeout = timeout

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.statement = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.fetchSize = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.queryId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.isAlign = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.timeout = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSFetchResultsReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.statement is not None:
            oprot.writeFieldBegin('statement', TType.STRING, 2)
            oprot.writeString(self.statement.encode('utf-8') if sys.version_info[0] == 2 else self.statement)
            oprot.writeFieldEnd()
        if self.fetchSize is not None:
            oprot.writeFieldBegin('fetchSize', TType.I32, 3)
            oprot.writeI32(self.fetchSize)
            oprot.writeFieldEnd()
        if self.queryId is not None:
            oprot.writeFieldBegin('queryId', TType.I64, 4)
            oprot.writeI64(self.queryId)
            oprot.writeFieldEnd()
        if self.isAlign is not None:
            oprot.writeFieldBegin('isAlign', TType.BOOL, 5)
            oprot.writeBool(self.isAlign)
            oprot.writeFieldEnd()
        if self.timeout is not None:
            oprot.writeFieldBegin('timeout', TType.I64, 6)
            oprot.writeI64(self.timeout)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSFetchResultsResp(object):
    """
    Attributes:
     - status
     - hasResultSet
     - isAlign
     - queryDataSet
     - nonAlignQueryDataSet

    """


    def __init__(self, status=None, hasResultSet=None, isAlign=None, queryDataSet=None, nonAlignQueryDataSet=None,):
        self.status = status
        self.hasResultSet = hasResultSet
        self.isAlign = isAlign
        self.queryDataSet = queryDataSet
        self.nonAlignQueryDataSet = nonAlignQueryDataSet

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.hasResultSet = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.isAlign = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.queryDataSet = TSQueryDataSet()
                    self.queryDataSet.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRUCT:
                    self.nonAlignQueryDataSet = TSQueryNonAlignDataSet()
                    self.nonAlignQueryDataSet.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSFetchResultsResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.hasResultSet is not None:
            oprot.writeFieldBegin('hasResultSet', TType.BOOL, 2)
            oprot.writeBool(self.hasResultSet)
            oprot.writeFieldEnd()
        if self.isAlign is not None:
            oprot.writeFieldBegin('isAlign', TType.BOOL, 3)
            oprot.writeBool(self.isAlign)
            oprot.writeFieldEnd()
        if self.queryDataSet is not None:
            oprot.writeFieldBegin('queryDataSet', TType.STRUCT, 4)
            self.queryDataSet.write(oprot)
            oprot.writeFieldEnd()
        if self.nonAlignQueryDataSet is not None:
            oprot.writeFieldBegin('nonAlignQueryDataSet', TType.STRUCT, 5)
            self.nonAlignQueryDataSet.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSFetchMetadataResp(object):
    """
    Attributes:
     - status
     - metadataInJson
     - columnsList
     - dataType

    """


    def __init__(self, status=None, metadataInJson=None, columnsList=None, dataType=None,):
        self.status = status
        self.metadataInJson = metadataInJson
        self.columnsList = columnsList
        self.dataType = dataType

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.metadataInJson = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.columnsList = []
                    (_etype114, _size111) = iprot.readListBegin()
                    for _i115 in range(_size111):
                        _elem116 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.columnsList.append(_elem116)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.dataType = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSFetchMetadataResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.metadataInJson is not None:
            oprot.writeFieldBegin('metadataInJson', TType.STRING, 2)
            oprot.writeString(self.metadataInJson.encode('utf-8') if sys.version_info[0] == 2 else self.metadataInJson)
            oprot.writeFieldEnd()
        if self.columnsList is not None:
            oprot.writeFieldBegin('columnsList', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.columnsList))
            for iter117 in self.columnsList:
                oprot.writeString(iter117.encode('utf-8') if sys.version_info[0] == 2 else iter117)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.dataType is not None:
            oprot.writeFieldBegin('dataType', TType.STRING, 4)
            oprot.writeString(self.dataType.encode('utf-8') if sys.version_info[0] == 2 else self.dataType)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSFetchMetadataReq(object):
    """
    Attributes:
     - sessionId
     - type
     - columnPath

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.type = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.columnPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSFetchMetadataReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.STRING, 2)
            oprot.writeString(self.type.encode('utf-8') if sys.version_info[0] == 2 else self.type)
            oprot.writeFieldEnd()
        if self.columnPath is not None:
            oprot.writeFieldBegin('columnPath', TType.STRING, 3)
            oprot.writeString(self.columnPath.encode('utf-8') if sys.version_info[0] == 2 else self.columnPath)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSGetSystemStatusResp(object):
    """
    Attributes:
     - status
     - systemStatus

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.systemStatus = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSGetSystemStatusResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.systemStatus is not None:
            oprot.writeFieldBegin('systemStatus', TType.STRING, 2)
            oprot.writeString(self.systemStatus.encode('utf-8') if sys.version_info[0] == 2 else self.systemStatus)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSGetTimeZoneResp(object):
    """
    Attributes:
     - status
     - timeZone

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.timeZone = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSGetTimeZoneResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.timeZone is not None:
            oprot.writeFieldBegin('timeZone', TType.STRING, 2)
            oprot.writeString(self.timeZone.encode('utf-8') if sys.version_info[0] == 2 else self.timeZone)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSSetTimeZoneReq(object):
    """
    Attributes:
     - sessionId
     - timeZone

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.timeZone = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSSetTimeZoneReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.timeZone is not None:
            oprot.writeFieldBegin('timeZone', TType.STRING, 2)
            oprot.writeString(self.timeZone.encode('utf-8') if sys.version_info[0] == 2 else self.timeZone)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertRecordReq(object):
    """
    Attributes:
     - sessionId
     - prefixPath
     - measurements
     - values
     - timestamp
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPath=None, measurements=None, values=None, timestamp=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPath = prefixPath
        self.measurements = measurements
        self.values = values
        self.timestamp = timestamp
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurements = []
                    (_etype121, _size118) = iprot.readListBegin()
                    for _i122 in range(_size118):
                        _elem123 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurements.append(_elem123)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.values = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.timestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertRecordReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 2)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        if self.measurements is not None:
            oprot.writeFieldBegin('measurements', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.measurements))
            for iter124 in self.measurements:
                oprot.writeString(iter124.encode('utf-8') if sys.version_info[0] == 2 else iter124)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.values is not None:
            oprot.writeFieldBegin('values', TType.STRING, 4)
            oprot.writeBinary(self.values)
            oprot.writeFieldEnd()
        if self.timestamp is not None:
            oprot.writeFieldBegin('timestamp', TType.I64, 5)
            oprot.writeI64(self.timestamp)
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 6)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertStringRecordReq(object):
    """
    Attributes:
     - sessionId
     - prefixPath
     - measurements
     - values
     - timestamp
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPath=None, measurements=None, values=None, timestamp=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPath = prefixPath
        self.measurements = measurements
        self.values = values
        self.timestamp = timestamp
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurements = []
                    (_etype128, _size125) = iprot.readListBegin()
                    for _i129 in range(_size125):
                        _elem130 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurements.append(_elem130)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.values = []
                    (_etype134, _size131) = iprot.readListBegin()
                    for _i135 in range(_size131):
                        _elem136 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.values.append(_elem136)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.timestamp = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertStringRecordReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 2)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        if self.measurements is not None:
            oprot.writeFieldBegin('measurements', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.measurements))
            for iter137 in self.measurements:
                oprot.writeString(iter137.encode('utf-8') if sys.version_info[0] == 2 else iter137)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.values is not None:
            oprot.writeFieldBegin('values', TType.LIST, 4)
            oprot.writeListBegin(TType.STRING, len(self.values))
            for iter138 in self.values:
                oprot.writeString(iter138.encode('utf-8') if sys.version_info[0] == 2 else iter138)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.timestamp is not None:
            oprot.writeFieldBegin('timestamp', TType.I64, 5)
            oprot.writeI64(self.timestamp)
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 6)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertTabletReq(object):
    """
    Attributes:
     - sessionId
     - prefixPath
     - measurements
     - values
     - timestamps
     - types
     - size
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPath=None, measurements=None, values=None, timestamps=None, types=None, size=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPath = prefixPath
        self.measurements = measurements
        self.values = values
        self.timestamps = timestamps
        self.types = types
        self.size = size
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurements = []
                    (_etype142, _size139) = iprot.readListBegin()
                    for _i143 in range(_size139):
                        _elem144 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurements.append(_elem144)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.values = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.timestamps = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.LIST:
                    self.types = []
                    (_etype148, _size145) = iprot.readListBegin()
                    for _i149 in range(_size145):
                        _elem150 = iprot.readI32()
                        self.types.append(_elem150)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I32:
                    self.size = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertTabletReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 2)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        if self.measurements is not None:
            oprot.writeFieldBegin('measurements', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.measurements))
            for iter151 in self.measurements:
                oprot.writeString(iter151.encode('utf-8') if sys.version_info[0] == 2 else iter151)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.values is not None:
            oprot.writeFieldBegin('values', TType.STRING, 4)
            oprot.writeBinary(self.values)
            oprot.writeFieldEnd()
        if self.timestamps is not None:
            oprot.writeFieldBegin('timestamps', TType.STRING, 5)
            oprot.writeBinary(self.timestamps)
            oprot.writeFieldEnd()
        if self.types is not None:
            oprot.writeFieldBegin('types', TType.LIST, 6)
            oprot.writeListBegin(TType.I32, len(self.types))
            for iter152 in self.types:
                oprot.writeI32(iter152)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.size is not None:
            oprot.writeFieldBegin('size', TType.I32, 7)
            oprot.writeI32(self.size)
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 8)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        if self.sessionId is None:
            raise TProtocolException(message='Required field sessionId is unset!')
        if self.prefixPath is None:
            raise TProtocolException(message='Required field prefixPath is unset!')
        if self.measurements is None:
            raise TProtocolException(message='Required field measurements is unset!')
        if self.values is None:
            raise TProtocolException(message='Required field values is unset!')
        if self.timestamps is None:
            raise TProtocolException(message='Required field timestamps is unset!')
        if self.types is None:
            raise TProtocolException(message='Required field types is unset!')
        if self.size is None:
            raise TProtocolException(message='Required field size is unset!')
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertTabletsReq(object):
    """
    Attributes:
     - sessionId
     - prefixPaths
     - measurementsList
     - valuesList
     - timestampsList
     - typesList
     - sizeList
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPaths=None, measurementsList=None, valuesList=None, timestampsList=None, typesList=None, sizeList=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPaths = prefixPaths
        self.measurementsList = measurementsList
        self.valuesList = valuesList
        self.timestampsList = timestampsList
        self.typesList = typesList
        self.sizeList = sizeList
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.prefixPaths = []
                    (_etype156, _size153) = iprot.readListBegin()
                    for _i157 in range(_size153):
                        _elem158 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.prefixPaths.append(_elem158)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurementsList = []
                    (_etype162, _size159) = iprot.readListBegin()
                    for _i163 in range(_size159):
                        _elem164 = []
                        (_etype168, _size165) = iprot.readListBegin()
                        for _i169 in range(_size165):
                            _elem170 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem164.append(_elem170)
                        iprot.readListEnd()
                        self.measurementsList.append(_elem164)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.valuesList = []
                    (_etype174, _size171) = iprot.readListBegin()
                    for _i175 in range(_size171):
                        _elem176 = iprot.readBinary()
                        self.valuesList.append(_elem176)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.timestampsList = []
                    (_etype180, _size177) = iprot.readListBegin()
                    for _i181 in range(_size177):
                        _elem182 = iprot.readBinary()
                        self.timestampsList.append(_elem182)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.LIST:
                    self.typesList = []
                    (_etype186, _size183) = iprot.readListBegin()
                    for _i187 in range(_size183):
                        _elem188 = []
                        (_etype192, _size189) = iprot.readListBegin()
                        for _i193 in range(_size189):
                            _elem194 = iprot.readI32()
                            _elem188.append(_elem194)
                        iprot.readListEnd()
                        self.typesList.append(_elem188)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.LIST:
                    self.sizeList = []
                    (_etype198, _size195) = iprot.readListBegin()
                    for _i199 in range(_size195):
                        _elem200 = iprot.readI32()
                        self.sizeList.append(_elem200)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertTabletsReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPaths is not None:
            oprot.writeFieldBegin('prefixPaths', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.prefixPaths))
            for iter201 in self.prefixPaths:
                oprot.writeString(iter201.encode('utf-8') if sys.version_info[0] == 2 else iter201)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.measurementsList is not None:
            oprot.writeFieldBegin('measurementsList', TType.LIST, 3)
            oprot.writeListBegin(TType.LIST, len(self.measurementsList))
            for iter202 in self.measurementsList:
                oprot.writeListBegin(TType.STRING, len(iter202))
                for iter203 in iter202:
                    oprot.writeString(iter203.encode('utf-8') if sys.version_info[0] == 2 else iter203)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.valuesList is not None:
            oprot.writeFieldBegin('valuesList', TType.LIST, 4)
            oprot.writeListBegin(TType.STRING, len(self.valuesList))
            for iter204 in self.valuesList:
                oprot.writeBinary(iter204)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.timestampsList is not None:
            oprot.writeFieldBegin('timestampsList', TType.LIST, 5)
            oprot.writeListBegin(TType.STRING, len(self.timestampsList))
            for iter205 in self.timestampsList:
                oprot.writeBinary(iter205)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.typesList is not None:
            oprot.writeFieldBegin('typesList', TType.LIST, 6)
            oprot.writeListBegin(TType.LIST, len(self.typesList))
            for iter206 in self.typesList:
                oprot.writeListBegin(TType.I32, len(iter206))
                for iter207 in iter206:
                    oprot.writeI32(iter207)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.sizeList is not None:
            oprot.writeFieldBegin('sizeList', TType.LIST, 7)
            oprot.writeListBegin(TType.I32, len(self.sizeList))
            for iter208 in self.sizeList:
                oprot.writeI32(iter208)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 8)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        if self.sessionId is None:
            raise TProtocolException(message='Required field sessionId is unset!')
        if self.prefixPaths is None:
            raise TProtocolException(message='Required field prefixPaths is unset!')
        if self.measurementsList is None:
            raise TProtocolException(message='Required field measurementsList is unset!')
        if self.valuesList is None:
            raise TProtocolException(message='Required field valuesList is unset!')
        if self.timestampsList is None:
            raise TProtocolException(message='Required field timestampsList is unset!')
        if self.typesList is None:
            raise TProtocolException(message='Required field typesList is unset!')
        if self.sizeList is None:
            raise TProtocolException(message='Required field sizeList is unset!')
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertRecordsReq(object):
    """
    Attributes:
     - sessionId
     - prefixPaths
     - measurementsList
     - valuesList
     - timestamps
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPaths=None, measurementsList=None, valuesList=None, timestamps=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPaths = prefixPaths
        self.measurementsList = measurementsList
        self.valuesList = valuesList
        self.timestamps = timestamps
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.prefixPaths = []
                    (_etype212, _size209) = iprot.readListBegin()
                    for _i213 in range(_size209):
                        _elem214 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.prefixPaths.append(_elem214)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurementsList = []
                    (_etype218, _size215) = iprot.readListBegin()
                    for _i219 in range(_size215):
                        _elem220 = []
                        (_etype224, _size221) = iprot.readListBegin()
                        for _i225 in range(_size221):
                            _elem226 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem220.append(_elem226)
                        iprot.readListEnd()
                        self.measurementsList.append(_elem220)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.valuesList = []
                    (_etype230, _size227) = iprot.readListBegin()
                    for _i231 in range(_size227):
                        _elem232 = iprot.readBinary()
                        self.valuesList.append(_elem232)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.timestamps = []
                    (_etype236, _size233) = iprot.readListBegin()
                    for _i237 in range(_size233):
                        _elem238 = iprot.readI64()
                        self.timestamps.append(_elem238)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertRecordsReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPaths is not None:
            oprot.writeFieldBegin('prefixPaths', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.prefixPaths))
            for iter239 in self.prefixPaths:
                oprot.writeString(iter239.encode('utf-8') if sys.version_info[0] == 2 else iter239)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.measurementsList is not None:
            oprot.writeFieldBegin('measurementsList', TType.LIST, 3)
            oprot.writeListBegin(TType.LIST, len(self.measurementsList))
            for iter240 in self.measurementsList:
                oprot.writeListBegin(TType.STRING, len(iter240))
                for iter241 in iter240:
                    oprot.writeString(iter241.encode('utf-8') if sys.version_info[0] == 2 else iter241)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.valuesList is not None:
            oprot.writeFieldBegin('valuesList', TType.LIST, 4)
            oprot.writeListBegin(TType.STRING, len(self.valuesList))
            for iter242 in self.valuesList:
                oprot.writeBinary(iter242)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.timestamps is not None:
            oprot.writeFieldBegin('timestamps', TType.LIST, 5)
            oprot.writeListBegin(TType.I64, len(self.timestamps))
            for iter243 in self.timestamps:
                oprot.writeI64(iter243)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 6)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertRecordsOfOneDeviceReq(object):
    """
    Attributes:
     - sessionId
     - prefixPath
     - measurementsList
     - valuesList
     - timestamps
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPath=None, measurementsList=None, valuesList=None, timestamps=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPath = prefixPath
        self.measurementsList = measurementsList
        self.valuesList = valuesList
        self.timestamps = timestamps
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurementsList = []
                    (_etype247, _size244) = iprot.readListBegin()
                    for _i248 in range(_size244):
                        _elem249 = []
                        (_etype253, _size250) = iprot.readListBegin()
                        for _i254 in range(_size250):
                            _elem255 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem249.append(_elem255)
                        iprot.readListEnd()
                        self.measurementsList.append(_elem249)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.valuesList = []
                    (_etype259, _size256) = iprot.readListBegin()
                    for _i260 in range(_size256):
                        _elem261 = iprot.readBinary()
                        self.valuesList.append(_elem261)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.timestamps = []
                    (_etype265, _size262) = iprot.readListBegin()
                    for _i266 in range(_size262):
                        _elem267 = iprot.readI64()
                        self.timestamps.append(_elem267)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertRecordsOfOneDeviceReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 2)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        if self.measurementsList is not None:
            oprot.writeFieldBegin('measurementsList', TType.LIST, 3)
            oprot.writeListBegin(TType.LIST, len(self.measurementsList))
            for iter268 in self.measurementsList:
                oprot.writeListBegin(TType.STRING, len(iter268))
                for iter269 in iter268:
                    oprot.writeString(iter269.encode('utf-8') if sys.version_info[0] == 2 else iter269)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.valuesList is not None:
            oprot.writeFieldBegin('valuesList', TType.LIST, 4)
            oprot.writeListBegin(TType.STRING, len(self.valuesList))
            for iter270 in self.valuesList:
                oprot.writeBinary(iter270)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.timestamps is not None:
            oprot.writeFieldBegin('timestamps', TType.LIST, 5)
            oprot.writeListBegin(TType.I64, len(self.timestamps))
            for iter271 in self.timestamps:
                oprot.writeI64(iter271)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 6)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertStringRecordsOfOneDeviceReq(object):
    """
    Attributes:
     - sessionId
     - prefixPath
     - measurementsList
     - valuesList
     - timestamps
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPath=None, measurementsList=None, valuesList=None, timestamps=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPath = prefixPath
        self.measurementsList = measurementsList
        self.valuesList = valuesList
        self.timestamps = timestamps
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurementsList = []
                    (_etype275, _size272) = iprot.readListBegin()
                    for _i276 in range(_size272):
                        _elem277 = []
                        (_etype281, _size278) = iprot.readListBegin()
                        for _i282 in range(_size278):
                            _elem283 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem277.append(_elem283)
                        iprot.readListEnd()
                        self.measurementsList.append(_elem277)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.valuesList = []
                    (_etype287, _size284) = iprot.readListBegin()
                    for _i288 in range(_size284):
                        _elem289 = []
                        (_etype293, _size290) = iprot.readListBegin()
                        for _i294 in range(_size290):
                            _elem295 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem289.append(_elem295)
                        iprot.readListEnd()
                        self.valuesList.append(_elem289)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.timestamps = []
                    (_etype299, _size296) = iprot.readListBegin()
                    for _i300 in range(_size296):
                        _elem301 = iprot.readI64()
                        self.timestamps.append(_elem301)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertStringRecordsOfOneDeviceReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 2)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        if self.measurementsList is not None:
            oprot.writeFieldBegin('measurementsList', TType.LIST, 3)
            oprot.writeListBegin(TType.LIST, len(self.measurementsList))
            for iter302 in self.measurementsList:
                oprot.writeListBegin(TType.STRING, len(iter302))
                for iter303 in iter302:
                    oprot.writeString(iter303.encode('utf-8') if sys.version_info[0] == 2 else iter303)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.valuesList is not None:
            oprot.writeFieldBegin('valuesList', TType.LIST, 4)
            oprot.writeListBegin(TType.LIST, len(self.valuesList))
            for iter304 in self.valuesList:
                oprot.writeListBegin(TType.STRING, len(iter304))
                for iter305 in iter304:
                    oprot.writeString(iter305.encode('utf-8') if sys.version_info[0] == 2 else iter305)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.timestamps is not None:
            oprot.writeFieldBegin('timestamps', TType.LIST, 5)
            oprot.writeListBegin(TType.I64, len(self.timestamps))
            for iter306 in self.timestamps:
                oprot.writeI64(iter306)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 6)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSInsertStringRecordsReq(object):
    """
    Attributes:
     - sessionId
     - prefixPaths
     - measurementsList
     - valuesList
     - timestamps
     - isAligned

    """


    def __init__(self, sessionId=None, prefixPaths=None, measurementsList=None, valuesList=None, timestamps=None, isAligned=None,):
        self.sessionId = sessionId
        self.prefixPaths = prefixPaths
        self.measurementsList = measurementsList
        self.valuesList = valuesList
        self.timestamps = timestamps
        self.isAligned = isAligned

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.prefixPaths = []
                    (_etype310, _size307) = iprot.readListBegin()
                    for _i311 in range(_size307):
                        _elem312 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.prefixPaths.append(_elem312)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurementsList = []
                    (_etype316, _size313) = iprot.readListBegin()
                    for _i317 in range(_size313):
                        _elem318 = []
                        (_etype322, _size319) = iprot.readListBegin()
                        for _i323 in range(_size319):
                            _elem324 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem318.append(_elem324)
                        iprot.readListEnd()
                        self.measurementsList.append(_elem318)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.valuesList = []
                    (_etype328, _size325) = iprot.readListBegin()
                    for _i329 in range(_size325):
                        _elem330 = []
                        (_etype334, _size331) = iprot.readListBegin()
                        for _i335 in range(_size331):
                            _elem336 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem330.append(_elem336)
                        iprot.readListEnd()
                        self.valuesList.append(_elem330)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.timestamps = []
                    (_etype340, _size337) = iprot.readListBegin()
                    for _i341 in range(_size337):
                        _elem342 = iprot.readI64()
                        self.timestamps.append(_elem342)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSInsertStringRecordsReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPaths is not None:
            oprot.writeFieldBegin('prefixPaths', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.prefixPaths))
            for iter343 in self.prefixPaths:
                oprot.writeString(iter343.encode('utf-8') if sys.version_info[0] == 2 else iter343)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.measurementsList is not None:
            oprot.writeFieldBegin('measurementsList', TType.LIST, 3)
            oprot.writeListBegin(TType.LIST, len(self.measurementsList))
            for iter344 in self.measurementsList:
                oprot.writeListBegin(TType.STRING, len(iter344))
                for iter345 in iter344:
                    oprot.writeString(iter345.encode('utf-8') if sys.version_info[0] == 2 else iter345)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.valuesList is not None:
            oprot.writeFieldBegin('valuesList', TType.LIST, 4)
            oprot.writeListBegin(TType.LIST, len(self.valuesList))
            for iter346 in self.valuesList:
                oprot.writeListBegin(TType.STRING, len(iter346))
                for iter347 in iter346:
                    oprot.writeString(iter347.encode('utf-8') if sys.version_info[0] == 2 else iter347)
                oprot.writeListEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.timestamps is not None:
            oprot.writeFieldBegin('timestamps', TType.LIST, 5)
            oprot.writeListBegin(TType.I64, len(self.timestamps))
            for iter348 in self.timestamps:
                oprot.writeI64(iter348)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 6)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSDeleteDataReq(object):
    """
    Attributes:
     - sessionId
     - paths
     - startTime
     - endTime

    """


    def __init__(self, sessionId=None, paths=None, startTime=None, endTime=None,):
        self.sessionId = sessionId
        self.paths = paths
        self.startTime = startTime
        self.endTime = endTime

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.paths = []
                    (_etype352, _size349) = iprot.readListBegin()
                    for _i353 in range(_size349):
                        _elem354 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.paths.append(_elem354)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.startTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.endTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSDeleteDataReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.paths is not None:
            oprot.writeFieldBegin('paths', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.paths))
            for iter355 in self.paths:
                oprot.writeString(iter355.encode('utf-8') if sys.version_info[0] == 2 else iter355)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.startTime is not None:
            oprot.writeFieldBegin('startTime', TType.I64, 3)
            oprot.writeI64(self.startTime)
            oprot.writeFieldEnd()
        if self.endTime is not None:
            oprot.writeFieldBegin('endTime', TType.I64, 4)
            oprot.writeI64(self.endTime)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSCreateTimeseriesReq(object):
    """
    Attributes:
     - sessionId
     - path
     - dataType
     - encoding
     - compressor
     - props
     - tags
     - attributes
     - measurementAlias

    """


    def __init__(self, sessionId=None, path=None, dataType=None, encoding=None, compressor=None, props=None, tags=None, attributes=None, measurementAlias=None,):
        self.sessionId = sessionId
        self.path = path
        self.dataType = dataType
        self.encoding = encoding
        self.compressor = compressor
        self.props = props
        self.tags = tags
        self.attributes = attributes
        self.measurementAlias = measurementAlias

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.path = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.dataType = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.encoding = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I32:
                    self.compressor = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.MAP:
                    self.props = {}
                    (_ktype357, _vtype358, _size356) = iprot.readMapBegin()
                    for _i360 in range(_size356):
                        _key361 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        _val362 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.props[_key361] = _val362
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.MAP:
                    self.tags = {}
                    (_ktype364, _vtype365, _size363) = iprot.readMapBegin()
                    for _i367 in range(_size363):
                        _key368 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        _val369 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.tags[_key368] = _val369
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.MAP:
                    self.attributes = {}
                    (_ktype371, _vtype372, _size370) = iprot.readMapBegin()
                    for _i374 in range(_size370):
                        _key375 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        _val376 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.attributes[_key375] = _val376
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.STRING:
                    self.measurementAlias = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSCreateTimeseriesReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.path is not None:
            oprot.writeFieldBegin('path', TType.STRING, 2)
            oprot.writeString(self.path.encode('utf-8') if sys.version_info[0] == 2 else self.path)
            oprot.writeFieldEnd()
        if self.dataType is not None:
            oprot.writeFieldBegin('dataType', TType.I32, 3)
            oprot.writeI32(self.dataType)
            oprot.writeFieldEnd()
        if self.encoding is not None:
            oprot.writeFieldBegin('encoding', TType.I32, 4)
            oprot.writeI32(self.encoding)
            oprot.writeFieldEnd()
        if self.compressor is not None:
            oprot.writeFieldBegin('compressor', TType.I32, 5)
            oprot.writeI32(self.compressor)
            oprot.writeFieldEnd()
        if self.props is not None:
            oprot.writeFieldBegin('props', TType.MAP, 6)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.props))
            for kiter377, viter378 in self.props.items():
                oprot.writeString(kiter377.encode('utf-8') if sys.version_info[0] == 2 else kiter377)
                oprot.writeString(viter378.encode('utf-8') if sys.version_info[0] == 2 else viter378)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.tags is not None:
            oprot.writeFieldBegin('tags', TType.MAP, 7)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.tags))
            for kiter379, viter380 in self.tags.items():
                oprot.writeString(kiter379.encode('utf-8') if sys.version_info[0] == 2 else kiter379)
                oprot.writeString(viter380.encode('utf-8') if sys.version_info[0] == 2 else viter380)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.attributes is not None:
            oprot.writeFieldBegin('attributes', TType.MAP, 8)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes))
            for kiter381, viter382 in self.attributes.items():
                oprot.writeString(kiter381.encode('utf-8') if sys.version_info[0] == 2 else kiter381)
                oprot.writeString(viter382.encode('utf-8') if sys.version_info[0] == 2 else viter382)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.measurementAlias is not None:
            oprot.writeFieldBegin('measurementAlias', TType.STRING, 9)
            oprot.writeString(self.measurementAlias.encode('utf-8') if sys.version_info[0] == 2 else self.measurementAlias)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSCreateAlignedTimeseriesReq(object):
    """
    Attributes:
     - sessionId
     - prefixPath
     - measurements
     - dataTypes
     - encodings
     - compressors
     - measurementAlias

    """


    def __init__(self, sessionId=None, prefixPath=None, measurements=None, dataTypes=None, encodings=None, compressors=None, measurementAlias=None,):
        self.sessionId = sessionId
        self.prefixPath = prefixPath
        self.measurements = measurements
        self.dataTypes = dataTypes
        self.encodings = encodings
        self.compressors = compressors
        self.measurementAlias = measurementAlias

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.measurements = []
                    (_etype386, _size383) = iprot.readListBegin()
                    for _i387 in range(_size383):
                        _elem388 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurements.append(_elem388)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.dataTypes = []
                    (_etype392, _size389) = iprot.readListBegin()
                    for _i393 in range(_size389):
                        _elem394 = iprot.readI32()
                        self.dataTypes.append(_elem394)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.encodings = []
                    (_etype398, _size395) = iprot.readListBegin()
                    for _i399 in range(_size395):
                        _elem400 = iprot.readI32()
                        self.encodings.append(_elem400)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.LIST:
                    self.compressors = []
                    (_etype404, _size401) = iprot.readListBegin()
                    for _i405 in range(_size401):
                        _elem406 = iprot.readI32()
                        self.compressors.append(_elem406)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.LIST:
                    self.measurementAlias = []
                    (_etype410, _size407) = iprot.readListBegin()
                    for _i411 in range(_size407):
                        _elem412 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurementAlias.append(_elem412)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSCreateAlignedTimeseriesReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 2)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        if self.measurements is not None:
            oprot.writeFieldBegin('measurements', TType.LIST, 3)
            oprot.writeListBegin(TType.STRING, len(self.measurements))
            for iter413 in self.measurements:
                oprot.writeString(iter413.encode('utf-8') if sys.version_info[0] == 2 else iter413)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.dataTypes is not None:
            oprot.writeFieldBegin('dataTypes', TType.LIST, 4)
            oprot.writeListBegin(TType.I32, len(self.dataTypes))
            for iter414 in self.dataTypes:
                oprot.writeI32(iter414)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.encodings is not None:
            oprot.writeFieldBegin('encodings', TType.LIST, 5)
            oprot.writeListBegin(TType.I32, len(self.encodings))
            for iter415 in self.encodings:
                oprot.writeI32(iter415)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.compressors is not None:
            oprot.writeFieldBegin('compressors', TType.LIST, 6)
            oprot.writeListBegin(TType.I32, len(self.compressors))
            for iter416 in self.compressors:
                oprot.writeI32(iter416)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.measurementAlias is not None:
            oprot.writeFieldBegin('measurementAlias', TType.LIST, 7)
            oprot.writeListBegin(TType.STRING, len(self.measurementAlias))
            for iter417 in self.measurementAlias:
                oprot.writeString(iter417.encode('utf-8') if sys.version_info[0] == 2 else iter417)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        if self.sessionId is None:
            raise TProtocolException(message='Required field sessionId is unset!')
        if self.prefixPath is None:
            raise TProtocolException(message='Required field prefixPath is unset!')
        if self.measurements is None:
            raise TProtocolException(message='Required field measurements is unset!')
        if self.dataTypes is None:
            raise TProtocolException(message='Required field dataTypes is unset!')
        if self.encodings is None:
            raise TProtocolException(message='Required field encodings is unset!')
        if self.compressors is None:
            raise TProtocolException(message='Required field compressors is unset!')
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSRawDataQueryReq(object):
    """
    Attributes:
     - sessionId
     - paths
     - fetchSize
     - startTime
     - endTime
     - statementId
     - enableRedirectQuery
     - jdbcQuery

    """


    def __init__(self, sessionId=None, paths=None, fetchSize=None, startTime=None, endTime=None, statementId=None, enableRedirectQuery=None, jdbcQuery=None,):
        self.sessionId = sessionId
        self.paths = paths
        self.fetchSize = fetchSize
        self.startTime = startTime
        self.endTime = endTime
        self.statementId = statementId
        self.enableRedirectQuery = enableRedirectQuery
        self.jdbcQuery = jdbcQuery

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.paths = []
                    (_etype421, _size418) = iprot.readListBegin()
                    for _i422 in range(_size418):
                        _elem423 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.paths.append(_elem423)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.fetchSize = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.startTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.endTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.statementId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.BOOL:
                    self.enableRedirectQuery = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.BOOL:
                    self.jdbcQuery = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSRawDataQueryReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.paths is not None:
            oprot.writeFieldBegin('paths', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.paths))
            for iter424 in self.paths:
                oprot.writeString(iter424.encode('utf-8') if sys.version_info[0] == 2 else iter424)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.fetchSize is not None:
            oprot.writeFieldBegin('fetchSize', TType.I32, 3)
            oprot.writeI32(self.fetchSize)
            oprot.writeFieldEnd()
        if self.startTime is not None:
            oprot.writeFieldBegin('startTime', TType.I64, 4)
            oprot.writeI64(self.startTime)
            oprot.writeFieldEnd()
        if self.endTime is not None:
            oprot.writeFieldBegin('endTime', TType.I64, 5)
            oprot.writeI64(self.endTime)
            oprot.writeFieldEnd()
        if self.statementId is not None:
            oprot.writeFieldBegin('statementId', TType.I64, 6)
            oprot.writeI64(self.statementId)
            oprot.writeFieldEnd()
        if self.enableRedirectQuery is not None:
            oprot.writeFieldBegin('enableRedirectQuery', TType.BOOL, 7)
            oprot.writeBool(self.enableRedirectQuery)
            oprot.writeFieldEnd()
        if self.jdbcQuery is not None:
            oprot.writeFieldBegin('jdbcQuery', TType.BOOL, 8)
            oprot.writeBool(self.jdbcQuery)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSLastDataQueryReq(object):
    """
    Attributes:
     - sessionId
     - paths
     - fetchSize
     - time
     - statementId
     - enableRedirectQuery
     - jdbcQuery

    """


    def __init__(self, sessionId=None, paths=None, fetchSize=None, time=None, statementId=None, enableRedirectQuery=None, jdbcQuery=None,):
        self.sessionId = sessionId
        self.paths = paths
        self.fetchSize = fetchSize
        self.time = time
        self.statementId = statementId
        self.enableRedirectQuery = enableRedirectQuery
        self.jdbcQuery = jdbcQuery

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.paths = []
                    (_etype428, _size425) = iprot.readListBegin()
                    for _i429 in range(_size425):
                        _elem430 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.paths.append(_elem430)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.fetchSize = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I64:
                    self.time = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I64:
                    self.statementId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.BOOL:
                    self.enableRedirectQuery = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.BOOL:
                    self.jdbcQuery = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSLastDataQueryReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.paths is not None:
            oprot.writeFieldBegin('paths', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.paths))
            for iter431 in self.paths:
                oprot.writeString(iter431.encode('utf-8') if sys.version_info[0] == 2 else iter431)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.fetchSize is not None:
            oprot.writeFieldBegin('fetchSize', TType.I32, 3)
            oprot.writeI32(self.fetchSize)
            oprot.writeFieldEnd()
        if self.time is not None:
            oprot.writeFieldBegin('time', TType.I64, 4)
            oprot.writeI64(self.time)
            oprot.writeFieldEnd()
        if self.statementId is not None:
            oprot.writeFieldBegin('statementId', TType.I64, 5)
            oprot.writeI64(self.statementId)
            oprot.writeFieldEnd()
        if self.enableRedirectQuery is not None:
            oprot.writeFieldBegin('enableRedirectQuery', TType.BOOL, 6)
            oprot.writeBool(self.enableRedirectQuery)
            oprot.writeFieldEnd()
        if self.jdbcQuery is not None:
            oprot.writeFieldBegin('jdbcQuery', TType.BOOL, 7)
            oprot.writeBool(self.jdbcQuery)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSCreateMultiTimeseriesReq(object):
    """
    Attributes:
     - sessionId
     - paths
     - dataTypes
     - encodings
     - compressors
     - propsList
     - tagsList
     - attributesList
     - measurementAliasList

    """


    def __init__(self, sessionId=None, paths=None, dataTypes=None, encodings=None, compressors=None, propsList=None, tagsList=None, attributesList=None, measurementAliasList=None,):
        self.sessionId = sessionId
        self.paths = paths
        self.dataTypes = dataTypes
        self.encodings = encodings
        self.compressors = compressors
        self.propsList = propsList
        self.tagsList = tagsList
        self.attributesList = attributesList
        self.measurementAliasList = measurementAliasList

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.paths = []
                    (_etype435, _size432) = iprot.readListBegin()
                    for _i436 in range(_size432):
                        _elem437 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.paths.append(_elem437)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.dataTypes = []
                    (_etype441, _size438) = iprot.readListBegin()
                    for _i442 in range(_size438):
                        _elem443 = iprot.readI32()
                        self.dataTypes.append(_elem443)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.encodings = []
                    (_etype447, _size444) = iprot.readListBegin()
                    for _i448 in range(_size444):
                        _elem449 = iprot.readI32()
                        self.encodings.append(_elem449)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.compressors = []
                    (_etype453, _size450) = iprot.readListBegin()
                    for _i454 in range(_size450):
                        _elem455 = iprot.readI32()
                        self.compressors.append(_elem455)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.LIST:
                    self.propsList = []
                    (_etype459, _size456) = iprot.readListBegin()
                    for _i460 in range(_size456):
                        _elem461 = {}
                        (_ktype463, _vtype464, _size462) = iprot.readMapBegin()
                        for _i466 in range(_size462):
                            _key467 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _val468 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem461[_key467] = _val468
                        iprot.readMapEnd()
                        self.propsList.append(_elem461)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.LIST:
                    self.tagsList = []
                    (_etype472, _size469) = iprot.readListBegin()
                    for _i473 in range(_size469):
                        _elem474 = {}
                        (_ktype476, _vtype477, _size475) = iprot.readMapBegin()
                        for _i479 in range(_size475):
                            _key480 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _val481 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem474[_key480] = _val481
                        iprot.readMapEnd()
                        self.tagsList.append(_elem474)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.LIST:
                    self.attributesList = []
                    (_etype485, _size482) = iprot.readListBegin()
                    for _i486 in range(_size482):
                        _elem487 = {}
                        (_ktype489, _vtype490, _size488) = iprot.readMapBegin()
                        for _i492 in range(_size488):
                            _key493 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _val494 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                            _elem487[_key493] = _val494
                        iprot.readMapEnd()
                        self.attributesList.append(_elem487)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.LIST:
                    self.measurementAliasList = []
                    (_etype498, _size495) = iprot.readListBegin()
                    for _i499 in range(_size495):
                        _elem500 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurementAliasList.append(_elem500)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSCreateMultiTimeseriesReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.paths is not None:
            oprot.writeFieldBegin('paths', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.paths))
            for iter501 in self.paths:
                oprot.writeString(iter501.encode('utf-8') if sys.version_info[0] == 2 else iter501)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.dataTypes is not None:
            oprot.writeFieldBegin('dataTypes', TType.LIST, 3)
            oprot.writeListBegin(TType.I32, len(self.dataTypes))
            for iter502 in self.dataTypes:
                oprot.writeI32(iter502)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.encodings is not None:
            oprot.writeFieldBegin('encodings', TType.LIST, 4)
            oprot.writeListBegin(TType.I32, len(self.encodings))
            for iter503 in self.encodings:
                oprot.writeI32(iter503)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.compressors is not None:
            oprot.writeFieldBegin('compressors', TType.LIST, 5)
            oprot.writeListBegin(TType.I32, len(self.compressors))
            for iter504 in self.compressors:
                oprot.writeI32(iter504)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.propsList is not None:
            oprot.writeFieldBegin('propsList', TType.LIST, 6)
            oprot.writeListBegin(TType.MAP, len(self.propsList))
            for iter505 in self.propsList:
                oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter505))
                for kiter506, viter507 in iter505.items():
                    oprot.writeString(kiter506.encode('utf-8') if sys.version_info[0] == 2 else kiter506)
                    oprot.writeString(viter507.encode('utf-8') if sys.version_info[0] == 2 else viter507)
                oprot.writeMapEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.tagsList is not None:
            oprot.writeFieldBegin('tagsList', TType.LIST, 7)
            oprot.writeListBegin(TType.MAP, len(self.tagsList))
            for iter508 in self.tagsList:
                oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter508))
                for kiter509, viter510 in iter508.items():
                    oprot.writeString(kiter509.encode('utf-8') if sys.version_info[0] == 2 else kiter509)
                    oprot.writeString(viter510.encode('utf-8') if sys.version_info[0] == 2 else viter510)
                oprot.writeMapEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.attributesList is not None:
            oprot.writeFieldBegin('attributesList', TType.LIST, 8)
            oprot.writeListBegin(TType.MAP, len(self.attributesList))
            for iter511 in self.attributesList:
                oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter511))
                for kiter512, viter513 in iter511.items():
                    oprot.writeString(kiter512.encode('utf-8') if sys.version_info[0] == 2 else kiter512)
                    oprot.writeString(viter513.encode('utf-8') if sys.version_info[0] == 2 else viter513)
                oprot.writeMapEnd()
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.measurementAliasList is not None:
            oprot.writeFieldBegin('measurementAliasList', TType.LIST, 9)
            oprot.writeListBegin(TType.STRING, len(self.measurementAliasList))
            for iter514 in self.measurementAliasList:
                oprot.writeString(iter514.encode('utf-8') if sys.version_info[0] == 2 else iter514)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 ServerProperties(object):
    """
    Attributes:
     - version
     - supportedTimeAggregationOperations
     - timestampPrecision
     - maxConcurrentClientNum
     - watermarkSecretKey
     - watermarkBitString
     - watermarkParamMarkRate
     - watermarkParamMaxRightBit
     - thriftMaxFrameSize
     - isReadOnly

    """


    def __init__(self, version=None, supportedTimeAggregationOperations=None, timestampPrecision=None, maxConcurrentClientNum=None, watermarkSecretKey=None, watermarkBitString=None, watermarkParamMarkRate=None, watermarkParamMaxRightBit=None, thriftMaxFrameSize=None, isReadOnly=None,):
        self.version = version
        self.supportedTimeAggregationOperations = supportedTimeAggregationOperations
        self.timestampPrecision = timestampPrecision
        self.maxConcurrentClientNum = maxConcurrentClientNum
        self.watermarkSecretKey = watermarkSecretKey
        self.watermarkBitString = watermarkBitString
        self.watermarkParamMarkRate = watermarkParamMarkRate
        self.watermarkParamMaxRightBit = watermarkParamMaxRightBit
        self.thriftMaxFrameSize = thriftMaxFrameSize
        self.isReadOnly = isReadOnly

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.version = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.LIST:
                    self.supportedTimeAggregationOperations = []
                    (_etype518, _size515) = iprot.readListBegin()
                    for _i519 in range(_size515):
                        _elem520 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.supportedTimeAggregationOperations.append(_elem520)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.timestampPrecision = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.maxConcurrentClientNum = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.watermarkSecretKey = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.watermarkBitString = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.I32:
                    self.watermarkParamMarkRate = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.I32:
                    self.watermarkParamMaxRightBit = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 9:
                if ftype == TType.I32:
                    self.thriftMaxFrameSize = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 10:
                if ftype == TType.BOOL:
                    self.isReadOnly = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('ServerProperties')
        if self.version is not None:
            oprot.writeFieldBegin('version', TType.STRING, 1)
            oprot.writeString(self.version.encode('utf-8') if sys.version_info[0] == 2 else self.version)
            oprot.writeFieldEnd()
        if self.supportedTimeAggregationOperations is not None:
            oprot.writeFieldBegin('supportedTimeAggregationOperations', TType.LIST, 2)
            oprot.writeListBegin(TType.STRING, len(self.supportedTimeAggregationOperations))
            for iter521 in self.supportedTimeAggregationOperations:
                oprot.writeString(iter521.encode('utf-8') if sys.version_info[0] == 2 else iter521)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.timestampPrecision is not None:
            oprot.writeFieldBegin('timestampPrecision', TType.STRING, 3)
            oprot.writeString(self.timestampPrecision.encode('utf-8') if sys.version_info[0] == 2 else self.timestampPrecision)
            oprot.writeFieldEnd()
        if self.maxConcurrentClientNum is not None:
            oprot.writeFieldBegin('maxConcurrentClientNum', TType.I32, 4)
            oprot.writeI32(self.maxConcurrentClientNum)
            oprot.writeFieldEnd()
        if self.watermarkSecretKey is not None:
            oprot.writeFieldBegin('watermarkSecretKey', TType.STRING, 5)
            oprot.writeString(self.watermarkSecretKey.encode('utf-8') if sys.version_info[0] == 2 else self.watermarkSecretKey)
            oprot.writeFieldEnd()
        if self.watermarkBitString is not None:
            oprot.writeFieldBegin('watermarkBitString', TType.STRING, 6)
            oprot.writeString(self.watermarkBitString.encode('utf-8') if sys.version_info[0] == 2 else self.watermarkBitString)
            oprot.writeFieldEnd()
        if self.watermarkParamMarkRate is not None:
            oprot.writeFieldBegin('watermarkParamMarkRate', TType.I32, 7)
            oprot.writeI32(self.watermarkParamMarkRate)
            oprot.writeFieldEnd()
        if self.watermarkParamMaxRightBit is not None:
            oprot.writeFieldBegin('watermarkParamMaxRightBit', TType.I32, 8)
            oprot.writeI32(self.watermarkParamMaxRightBit)
            oprot.writeFieldEnd()
        if self.thriftMaxFrameSize is not None:
            oprot.writeFieldBegin('thriftMaxFrameSize', TType.I32, 9)
            oprot.writeI32(self.thriftMaxFrameSize)
            oprot.writeFieldEnd()
        if self.isReadOnly is not None:
            oprot.writeFieldBegin('isReadOnly', TType.BOOL, 10)
            oprot.writeBool(self.isReadOnly)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSSetSchemaTemplateReq(object):
    """
    Attributes:
     - sessionId
     - templateName
     - prefixPath

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.templateName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSSetSchemaTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.templateName is not None:
            oprot.writeFieldBegin('templateName', TType.STRING, 2)
            oprot.writeString(self.templateName.encode('utf-8') if sys.version_info[0] == 2 else self.templateName)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 3)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSCreateSchemaTemplateReq(object):
    """
    Attributes:
     - sessionId
     - name
     - serializedTemplate

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.serializedTemplate = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSCreateSchemaTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.serializedTemplate is not None:
            oprot.writeFieldBegin('serializedTemplate', TType.STRING, 3)
            oprot.writeBinary(self.serializedTemplate)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSAppendSchemaTemplateReq(object):
    """
    Attributes:
     - sessionId
     - name
     - isAligned
     - measurements
     - dataTypes
     - encodings
     - compressors

    """


    def __init__(self, sessionId=None, name=None, isAligned=None, measurements=None, dataTypes=None, encodings=None, compressors=None,):
        self.sessionId = sessionId
        self.name = name
        self.isAligned = isAligned
        self.measurements = measurements
        self.dataTypes = dataTypes
        self.encodings = encodings
        self.compressors = compressors

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.isAligned = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.LIST:
                    self.measurements = []
                    (_etype525, _size522) = iprot.readListBegin()
                    for _i526 in range(_size522):
                        _elem527 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurements.append(_elem527)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.dataTypes = []
                    (_etype531, _size528) = iprot.readListBegin()
                    for _i532 in range(_size528):
                        _elem533 = iprot.readI32()
                        self.dataTypes.append(_elem533)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.LIST:
                    self.encodings = []
                    (_etype537, _size534) = iprot.readListBegin()
                    for _i538 in range(_size534):
                        _elem539 = iprot.readI32()
                        self.encodings.append(_elem539)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.LIST:
                    self.compressors = []
                    (_etype543, _size540) = iprot.readListBegin()
                    for _i544 in range(_size540):
                        _elem545 = iprot.readI32()
                        self.compressors.append(_elem545)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSAppendSchemaTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.isAligned is not None:
            oprot.writeFieldBegin('isAligned', TType.BOOL, 3)
            oprot.writeBool(self.isAligned)
            oprot.writeFieldEnd()
        if self.measurements is not None:
            oprot.writeFieldBegin('measurements', TType.LIST, 4)
            oprot.writeListBegin(TType.STRING, len(self.measurements))
            for iter546 in self.measurements:
                oprot.writeString(iter546.encode('utf-8') if sys.version_info[0] == 2 else iter546)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.dataTypes is not None:
            oprot.writeFieldBegin('dataTypes', TType.LIST, 5)
            oprot.writeListBegin(TType.I32, len(self.dataTypes))
            for iter547 in self.dataTypes:
                oprot.writeI32(iter547)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.encodings is not None:
            oprot.writeFieldBegin('encodings', TType.LIST, 6)
            oprot.writeListBegin(TType.I32, len(self.encodings))
            for iter548 in self.encodings:
                oprot.writeI32(iter548)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.compressors is not None:
            oprot.writeFieldBegin('compressors', TType.LIST, 7)
            oprot.writeListBegin(TType.I32, len(self.compressors))
            for iter549 in self.compressors:
                oprot.writeI32(iter549)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        if self.sessionId is None:
            raise TProtocolException(message='Required field sessionId is unset!')
        if self.name is None:
            raise TProtocolException(message='Required field name is unset!')
        if self.isAligned is None:
            raise TProtocolException(message='Required field isAligned is unset!')
        if self.measurements is None:
            raise TProtocolException(message='Required field measurements is unset!')
        if self.dataTypes is None:
            raise TProtocolException(message='Required field dataTypes is unset!')
        if self.encodings is None:
            raise TProtocolException(message='Required field encodings is unset!')
        if self.compressors is None:
            raise TProtocolException(message='Required field compressors is unset!')
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSPruneSchemaTemplateReq(object):
    """
    Attributes:
     - sessionId
     - name
     - path

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.path = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSPruneSchemaTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.path is not None:
            oprot.writeFieldBegin('path', TType.STRING, 3)
            oprot.writeString(self.path.encode('utf-8') if sys.version_info[0] == 2 else self.path)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSQueryTemplateReq(object):
    """
    Attributes:
     - sessionId
     - name
     - queryType
     - measurement

    """


    def __init__(self, sessionId=None, name=None, queryType=None, measurement=None,):
        self.sessionId = sessionId
        self.name = name
        self.queryType = queryType
        self.measurement = measurement

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.queryType = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.measurement = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSQueryTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.queryType is not None:
            oprot.writeFieldBegin('queryType', TType.I32, 3)
            oprot.writeI32(self.queryType)
            oprot.writeFieldEnd()
        if self.measurement is not None:
            oprot.writeFieldBegin('measurement', TType.STRING, 4)
            oprot.writeString(self.measurement.encode('utf-8') if sys.version_info[0] == 2 else self.measurement)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSQueryTemplateResp(object):
    """
    Attributes:
     - status
     - queryType
     - result
     - count
     - measurements

    """


    def __init__(self, status=None, queryType=None, result=None, count=None, measurements=None,):
        self.status = status
        self.queryType = queryType
        self.result = result
        self.count = count
        self.measurements = measurements

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.queryType = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.result = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.count = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.LIST:
                    self.measurements = []
                    (_etype553, _size550) = iprot.readListBegin()
                    for _i554 in range(_size550):
                        _elem555 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                        self.measurements.append(_elem555)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSQueryTemplateResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.queryType is not None:
            oprot.writeFieldBegin('queryType', TType.I32, 2)
            oprot.writeI32(self.queryType)
            oprot.writeFieldEnd()
        if self.result is not None:
            oprot.writeFieldBegin('result', TType.BOOL, 3)
            oprot.writeBool(self.result)
            oprot.writeFieldEnd()
        if self.count is not None:
            oprot.writeFieldBegin('count', TType.I32, 4)
            oprot.writeI32(self.count)
            oprot.writeFieldEnd()
        if self.measurements is not None:
            oprot.writeFieldBegin('measurements', TType.LIST, 5)
            oprot.writeListBegin(TType.STRING, len(self.measurements))
            for iter556 in self.measurements:
                oprot.writeString(iter556.encode('utf-8') if sys.version_info[0] == 2 else iter556)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSUnsetSchemaTemplateReq(object):
    """
    Attributes:
     - sessionId
     - prefixPath
     - templateName

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.prefixPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.templateName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSUnsetSchemaTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.prefixPath is not None:
            oprot.writeFieldBegin('prefixPath', TType.STRING, 2)
            oprot.writeString(self.prefixPath.encode('utf-8') if sys.version_info[0] == 2 else self.prefixPath)
            oprot.writeFieldEnd()
        if self.templateName is not None:
            oprot.writeFieldBegin('templateName', TType.STRING, 3)
            oprot.writeString(self.templateName.encode('utf-8') if sys.version_info[0] == 2 else self.templateName)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSSetUsingTemplateReq(object):
    """
    Attributes:
     - sessionId
     - dstPath

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.dstPath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSSetUsingTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.dstPath is not None:
            oprot.writeFieldBegin('dstPath', TType.STRING, 2)
            oprot.writeString(self.dstPath.encode('utf-8') if sys.version_info[0] == 2 else self.dstPath)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSDropSchemaTemplateReq(object):
    """
    Attributes:
     - sessionId
     - templateName

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.templateName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSDropSchemaTemplateReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.templateName is not None:
            oprot.writeFieldBegin('templateName', TType.STRING, 2)
            oprot.writeString(self.templateName.encode('utf-8') if sys.version_info[0] == 2 else self.templateName)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSOperationSyncWriteReq(object):
    """
    Attributes:
     - sessionId
     - operationSyncType
     - physicalPlan

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I64:
                    self.sessionId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BYTE:
                    self.operationSyncType = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.physicalPlan = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSOperationSyncWriteReq')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.I64, 1)
            oprot.writeI64(self.sessionId)
            oprot.writeFieldEnd()
        if self.operationSyncType is not None:
            oprot.writeFieldBegin('operationSyncType', TType.BYTE, 2)
            oprot.writeByte(self.operationSyncType)
            oprot.writeFieldEnd()
        if self.physicalPlan is not None:
            oprot.writeFieldBegin('physicalPlan', TType.STRING, 3)
            oprot.writeBinary(self.physicalPlan)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSBackupConfigurationResp(object):
    """
    Attributes:
     - status
     - enableOperationSync
     - secondaryAddress
     - secondaryPort

    """


    def __init__(self, status=None, enableOperationSync=None, secondaryAddress=None, secondaryPort=None,):
        self.status = status
        self.enableOperationSync = enableOperationSync
        self.secondaryAddress = secondaryAddress
        self.secondaryPort = secondaryPort

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRUCT:
                    self.status = TSStatus()
                    self.status.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.enableOperationSync = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.secondaryAddress = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.secondaryPort = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSBackupConfigurationResp')
        if self.status is not None:
            oprot.writeFieldBegin('status', TType.STRUCT, 1)
            self.status.write(oprot)
            oprot.writeFieldEnd()
        if self.enableOperationSync is not None:
            oprot.writeFieldBegin('enableOperationSync', TType.BOOL, 2)
            oprot.writeBool(self.enableOperationSync)
            oprot.writeFieldEnd()
        if self.secondaryAddress is not None:
            oprot.writeFieldBegin('secondaryAddress', TType.STRING, 3)
            oprot.writeString(self.secondaryAddress.encode('utf-8') if sys.version_info[0] == 2 else self.secondaryAddress)
            oprot.writeFieldEnd()
        if self.secondaryPort is not None:
            oprot.writeFieldBegin('secondaryPort', TType.I32, 4)
            oprot.writeI32(self.secondaryPort)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSConnectionInfo(object):
    """
    Attributes:
     - userName
     - logInTime
     - connectionId
     - type

    """


    def __init__(self, userName=None, logInTime=None, connectionId=None, type=None,):
        self.userName = userName
        self.logInTime = logInTime
        self.connectionId = connectionId
        self.type = type

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.userName = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.logInTime = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.connectionId = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.type = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSConnectionInfo')
        if self.userName is not None:
            oprot.writeFieldBegin('userName', TType.STRING, 1)
            oprot.writeString(self.userName.encode('utf-8') if sys.version_info[0] == 2 else self.userName)
            oprot.writeFieldEnd()
        if self.logInTime is not None:
            oprot.writeFieldBegin('logInTime', TType.I64, 2)
            oprot.writeI64(self.logInTime)
            oprot.writeFieldEnd()
        if self.connectionId is not None:
            oprot.writeFieldBegin('connectionId', TType.STRING, 3)
            oprot.writeString(self.connectionId.encode('utf-8') if sys.version_info[0] == 2 else self.connectionId)
            oprot.writeFieldEnd()
        if self.type is not None:
            oprot.writeFieldBegin('type', TType.I32, 4)
            oprot.writeI32(self.type)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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 TSConnectionInfoResp(object):
    """
    Attributes:
     - connectionInfoList

    """


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

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.LIST:
                    self.connectionInfoList = []
                    (_etype560, _size557) = iprot.readListBegin()
                    for _i561 in range(_size557):
                        _elem562 = TSConnectionInfo()
                        _elem562.read(iprot)
                        self.connectionInfoList.append(_elem562)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('TSConnectionInfoResp')
        if self.connectionInfoList is not None:
            oprot.writeFieldBegin('connectionInfoList', TType.LIST, 1)
            oprot.writeListBegin(TType.STRUCT, len(self.connectionInfoList))
            for iter563 in self.connectionInfoList:
                iter563.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

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

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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)
all_structs.append(EndPoint)
EndPoint.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'ip', 'UTF8', None, ),  # 1
    (2, TType.I32, 'port', None, None, ),  # 2
)
all_structs.append(TSStatus)
TSStatus.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'code', None, None, ),  # 1
    (2, TType.STRING, 'message', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'subStatus', (TType.STRUCT, [TSStatus, None], False), None, ),  # 3
    (4, TType.STRUCT, 'redirectNode', [EndPoint, None], None, ),  # 4
)
all_structs.append(TSQueryDataSet)
TSQueryDataSet.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'time', 'BINARY', None, ),  # 1
    (2, TType.LIST, 'valueList', (TType.STRING, 'BINARY', False), None, ),  # 2
    (3, TType.LIST, 'bitmapList', (TType.STRING, 'BINARY', False), None, ),  # 3
)
all_structs.append(TSQueryNonAlignDataSet)
TSQueryNonAlignDataSet.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'timeList', (TType.STRING, 'BINARY', False), None, ),  # 1
    (2, TType.LIST, 'valueList', (TType.STRING, 'BINARY', False), None, ),  # 2
)
all_structs.append(TSTracingInfo)
TSTracingInfo.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'activityList', (TType.STRING, 'UTF8', False), None, ),  # 1
    (2, TType.LIST, 'elapsedTimeList', (TType.I64, None, False), None, ),  # 2
    (3, TType.I32, 'seriesPathNum', None, None, ),  # 3
    (4, TType.I32, 'seqFileNum', None, None, ),  # 4
    (5, TType.I32, 'unSeqFileNum', None, None, ),  # 5
    (6, TType.I32, 'sequenceChunkNum', None, None, ),  # 6
    (7, TType.I64, 'sequenceChunkPointNum', None, None, ),  # 7
    (8, TType.I32, 'unsequenceChunkNum', None, None, ),  # 8
    (9, TType.I64, 'unsequenceChunkPointNum', None, None, ),  # 9
    (10, TType.I32, 'totalPageNum', None, None, ),  # 10
    (11, TType.I32, 'overlappedPageNum', None, None, ),  # 11
)
all_structs.append(TSExecuteStatementResp)
TSExecuteStatementResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.I64, 'queryId', None, None, ),  # 2
    (3, TType.LIST, 'columns', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.STRING, 'operationType', 'UTF8', None, ),  # 4
    (5, TType.BOOL, 'ignoreTimeStamp', None, None, ),  # 5
    (6, TType.LIST, 'dataTypeList', (TType.STRING, 'UTF8', False), None, ),  # 6
    (7, TType.STRUCT, 'queryDataSet', [TSQueryDataSet, None], None, ),  # 7
    (8, TType.STRUCT, 'nonAlignQueryDataSet', [TSQueryNonAlignDataSet, None], None, ),  # 8
    (9, TType.MAP, 'columnNameIndexMap', (TType.STRING, 'UTF8', TType.I32, None, False), None, ),  # 9
    (10, TType.LIST, 'sgColumns', (TType.STRING, 'UTF8', False), None, ),  # 10
    (11, TType.LIST, 'aliasColumns', (TType.BYTE, None, False), None, ),  # 11
    (12, TType.STRUCT, 'tracingInfo', [TSTracingInfo, None], None, ),  # 12
)
all_structs.append(TSOpenSessionResp)
TSOpenSessionResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.I32, 'serverProtocolVersion', None, 0, ),  # 2
    (3, TType.I64, 'sessionId', None, None, ),  # 3
    (4, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 4
)
all_structs.append(TSOpenSessionReq)
TSOpenSessionReq.thrift_spec = (
    None,  # 0
    (1, TType.I32, 'client_protocol', None, 2, ),  # 1
    (2, TType.STRING, 'zoneId', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'username', 'UTF8', None, ),  # 3
    (4, TType.STRING, 'password', 'UTF8', None, ),  # 4
    (5, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 5
)
all_structs.append(TSCloseSessionReq)
TSCloseSessionReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
)
all_structs.append(TSExecuteStatementReq)
TSExecuteStatementReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'statement', 'UTF8', None, ),  # 2
    (3, TType.I64, 'statementId', None, None, ),  # 3
    (4, TType.I32, 'fetchSize', None, None, ),  # 4
    (5, TType.I64, 'timeout', None, None, ),  # 5
    (6, TType.BOOL, 'enableRedirectQuery', None, None, ),  # 6
    (7, TType.BOOL, 'jdbcQuery', None, None, ),  # 7
)
all_structs.append(TSExecuteBatchStatementReq)
TSExecuteBatchStatementReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'statements', (TType.STRING, 'UTF8', False), None, ),  # 2
)
all_structs.append(TSGetOperationStatusReq)
TSGetOperationStatusReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.I64, 'queryId', None, None, ),  # 2
)
all_structs.append(TSCancelOperationReq)
TSCancelOperationReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.I64, 'queryId', None, None, ),  # 2
)
all_structs.append(TSCloseOperationReq)
TSCloseOperationReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.I64, 'queryId', None, None, ),  # 2
    (3, TType.I64, 'statementId', None, None, ),  # 3
)
all_structs.append(TSFetchResultsReq)
TSFetchResultsReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'statement', 'UTF8', None, ),  # 2
    (3, TType.I32, 'fetchSize', None, None, ),  # 3
    (4, TType.I64, 'queryId', None, None, ),  # 4
    (5, TType.BOOL, 'isAlign', None, None, ),  # 5
    (6, TType.I64, 'timeout', None, None, ),  # 6
)
all_structs.append(TSFetchResultsResp)
TSFetchResultsResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.BOOL, 'hasResultSet', None, None, ),  # 2
    (3, TType.BOOL, 'isAlign', None, None, ),  # 3
    (4, TType.STRUCT, 'queryDataSet', [TSQueryDataSet, None], None, ),  # 4
    (5, TType.STRUCT, 'nonAlignQueryDataSet', [TSQueryNonAlignDataSet, None], None, ),  # 5
)
all_structs.append(TSFetchMetadataResp)
TSFetchMetadataResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.STRING, 'metadataInJson', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'columnsList', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.STRING, 'dataType', 'UTF8', None, ),  # 4
)
all_structs.append(TSFetchMetadataReq)
TSFetchMetadataReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'type', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'columnPath', 'UTF8', None, ),  # 3
)
all_structs.append(TSGetSystemStatusResp)
TSGetSystemStatusResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.STRING, 'systemStatus', 'UTF8', None, ),  # 2
)
all_structs.append(TSGetTimeZoneResp)
TSGetTimeZoneResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.STRING, 'timeZone', 'UTF8', None, ),  # 2
)
all_structs.append(TSSetTimeZoneReq)
TSSetTimeZoneReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'timeZone', 'UTF8', None, ),  # 2
)
all_structs.append(TSInsertRecordReq)
TSInsertRecordReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'measurements', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.STRING, 'values', 'BINARY', None, ),  # 4
    (5, TType.I64, 'timestamp', None, None, ),  # 5
    (6, TType.BOOL, 'isAligned', None, None, ),  # 6
)
all_structs.append(TSInsertStringRecordReq)
TSInsertStringRecordReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'measurements', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.LIST, 'values', (TType.STRING, 'UTF8', False), None, ),  # 4
    (5, TType.I64, 'timestamp', None, None, ),  # 5
    (6, TType.BOOL, 'isAligned', None, None, ),  # 6
)
all_structs.append(TSInsertTabletReq)
TSInsertTabletReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'measurements', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.STRING, 'values', 'BINARY', None, ),  # 4
    (5, TType.STRING, 'timestamps', 'BINARY', None, ),  # 5
    (6, TType.LIST, 'types', (TType.I32, None, False), None, ),  # 6
    (7, TType.I32, 'size', None, None, ),  # 7
    (8, TType.BOOL, 'isAligned', None, None, ),  # 8
)
all_structs.append(TSInsertTabletsReq)
TSInsertTabletsReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'prefixPaths', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.LIST, 'measurementsList', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 3
    (4, TType.LIST, 'valuesList', (TType.STRING, 'BINARY', False), None, ),  # 4
    (5, TType.LIST, 'timestampsList', (TType.STRING, 'BINARY', False), None, ),  # 5
    (6, TType.LIST, 'typesList', (TType.LIST, (TType.I32, None, False), False), None, ),  # 6
    (7, TType.LIST, 'sizeList', (TType.I32, None, False), None, ),  # 7
    (8, TType.BOOL, 'isAligned', None, None, ),  # 8
)
all_structs.append(TSInsertRecordsReq)
TSInsertRecordsReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'prefixPaths', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.LIST, 'measurementsList', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 3
    (4, TType.LIST, 'valuesList', (TType.STRING, 'BINARY', False), None, ),  # 4
    (5, TType.LIST, 'timestamps', (TType.I64, None, False), None, ),  # 5
    (6, TType.BOOL, 'isAligned', None, None, ),  # 6
)
all_structs.append(TSInsertRecordsOfOneDeviceReq)
TSInsertRecordsOfOneDeviceReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'measurementsList', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 3
    (4, TType.LIST, 'valuesList', (TType.STRING, 'BINARY', False), None, ),  # 4
    (5, TType.LIST, 'timestamps', (TType.I64, None, False), None, ),  # 5
    (6, TType.BOOL, 'isAligned', None, None, ),  # 6
)
all_structs.append(TSInsertStringRecordsOfOneDeviceReq)
TSInsertStringRecordsOfOneDeviceReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'measurementsList', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 3
    (4, TType.LIST, 'valuesList', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 4
    (5, TType.LIST, 'timestamps', (TType.I64, None, False), None, ),  # 5
    (6, TType.BOOL, 'isAligned', None, None, ),  # 6
)
all_structs.append(TSInsertStringRecordsReq)
TSInsertStringRecordsReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'prefixPaths', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.LIST, 'measurementsList', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 3
    (4, TType.LIST, 'valuesList', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ),  # 4
    (5, TType.LIST, 'timestamps', (TType.I64, None, False), None, ),  # 5
    (6, TType.BOOL, 'isAligned', None, None, ),  # 6
)
all_structs.append(TSDeleteDataReq)
TSDeleteDataReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'paths', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.I64, 'startTime', None, None, ),  # 3
    (4, TType.I64, 'endTime', None, None, ),  # 4
)
all_structs.append(TSCreateTimeseriesReq)
TSCreateTimeseriesReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'path', 'UTF8', None, ),  # 2
    (3, TType.I32, 'dataType', None, None, ),  # 3
    (4, TType.I32, 'encoding', None, None, ),  # 4
    (5, TType.I32, 'compressor', None, None, ),  # 5
    (6, TType.MAP, 'props', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 6
    (7, TType.MAP, 'tags', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 7
    (8, TType.MAP, 'attributes', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 8
    (9, TType.STRING, 'measurementAlias', 'UTF8', None, ),  # 9
)
all_structs.append(TSCreateAlignedTimeseriesReq)
TSCreateAlignedTimeseriesReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 2
    (3, TType.LIST, 'measurements', (TType.STRING, 'UTF8', False), None, ),  # 3
    (4, TType.LIST, 'dataTypes', (TType.I32, None, False), None, ),  # 4
    (5, TType.LIST, 'encodings', (TType.I32, None, False), None, ),  # 5
    (6, TType.LIST, 'compressors', (TType.I32, None, False), None, ),  # 6
    (7, TType.LIST, 'measurementAlias', (TType.STRING, 'UTF8', False), None, ),  # 7
)
all_structs.append(TSRawDataQueryReq)
TSRawDataQueryReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'paths', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.I32, 'fetchSize', None, None, ),  # 3
    (4, TType.I64, 'startTime', None, None, ),  # 4
    (5, TType.I64, 'endTime', None, None, ),  # 5
    (6, TType.I64, 'statementId', None, None, ),  # 6
    (7, TType.BOOL, 'enableRedirectQuery', None, None, ),  # 7
    (8, TType.BOOL, 'jdbcQuery', None, None, ),  # 8
)
all_structs.append(TSLastDataQueryReq)
TSLastDataQueryReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'paths', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.I32, 'fetchSize', None, None, ),  # 3
    (4, TType.I64, 'time', None, None, ),  # 4
    (5, TType.I64, 'statementId', None, None, ),  # 5
    (6, TType.BOOL, 'enableRedirectQuery', None, None, ),  # 6
    (7, TType.BOOL, 'jdbcQuery', None, None, ),  # 7
)
all_structs.append(TSCreateMultiTimeseriesReq)
TSCreateMultiTimeseriesReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.LIST, 'paths', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.LIST, 'dataTypes', (TType.I32, None, False), None, ),  # 3
    (4, TType.LIST, 'encodings', (TType.I32, None, False), None, ),  # 4
    (5, TType.LIST, 'compressors', (TType.I32, None, False), None, ),  # 5
    (6, TType.LIST, 'propsList', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ),  # 6
    (7, TType.LIST, 'tagsList', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ),  # 7
    (8, TType.LIST, 'attributesList', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ),  # 8
    (9, TType.LIST, 'measurementAliasList', (TType.STRING, 'UTF8', False), None, ),  # 9
)
all_structs.append(ServerProperties)
ServerProperties.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'version', 'UTF8', None, ),  # 1
    (2, TType.LIST, 'supportedTimeAggregationOperations', (TType.STRING, 'UTF8', False), None, ),  # 2
    (3, TType.STRING, 'timestampPrecision', 'UTF8', None, ),  # 3
    (4, TType.I32, 'maxConcurrentClientNum', None, None, ),  # 4
    (5, TType.STRING, 'watermarkSecretKey', 'UTF8', None, ),  # 5
    (6, TType.STRING, 'watermarkBitString', 'UTF8', None, ),  # 6
    (7, TType.I32, 'watermarkParamMarkRate', None, None, ),  # 7
    (8, TType.I32, 'watermarkParamMaxRightBit', None, None, ),  # 8
    (9, TType.I32, 'thriftMaxFrameSize', None, None, ),  # 9
    (10, TType.BOOL, 'isReadOnly', None, None, ),  # 10
)
all_structs.append(TSSetSchemaTemplateReq)
TSSetSchemaTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'templateName', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 3
)
all_structs.append(TSCreateSchemaTemplateReq)
TSCreateSchemaTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'serializedTemplate', 'BINARY', None, ),  # 3
)
all_structs.append(TSAppendSchemaTemplateReq)
TSAppendSchemaTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.BOOL, 'isAligned', None, None, ),  # 3
    (4, TType.LIST, 'measurements', (TType.STRING, 'UTF8', False), None, ),  # 4
    (5, TType.LIST, 'dataTypes', (TType.I32, None, False), None, ),  # 5
    (6, TType.LIST, 'encodings', (TType.I32, None, False), None, ),  # 6
    (7, TType.LIST, 'compressors', (TType.I32, None, False), None, ),  # 7
)
all_structs.append(TSPruneSchemaTemplateReq)
TSPruneSchemaTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'path', 'UTF8', None, ),  # 3
)
all_structs.append(TSQueryTemplateReq)
TSQueryTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
    (3, TType.I32, 'queryType', None, None, ),  # 3
    (4, TType.STRING, 'measurement', 'UTF8', None, ),  # 4
)
all_structs.append(TSQueryTemplateResp)
TSQueryTemplateResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.I32, 'queryType', None, None, ),  # 2
    (3, TType.BOOL, 'result', None, None, ),  # 3
    (4, TType.I32, 'count', None, None, ),  # 4
    (5, TType.LIST, 'measurements', (TType.STRING, 'UTF8', False), None, ),  # 5
)
all_structs.append(TSUnsetSchemaTemplateReq)
TSUnsetSchemaTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'prefixPath', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'templateName', 'UTF8', None, ),  # 3
)
all_structs.append(TSSetUsingTemplateReq)
TSSetUsingTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'dstPath', 'UTF8', None, ),  # 2
)
all_structs.append(TSDropSchemaTemplateReq)
TSDropSchemaTemplateReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.STRING, 'templateName', 'UTF8', None, ),  # 2
)
all_structs.append(TSOperationSyncWriteReq)
TSOperationSyncWriteReq.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'sessionId', None, None, ),  # 1
    (2, TType.BYTE, 'operationSyncType', None, None, ),  # 2
    (3, TType.STRING, 'physicalPlan', 'BINARY', None, ),  # 3
)
all_structs.append(TSBackupConfigurationResp)
TSBackupConfigurationResp.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'status', [TSStatus, None], None, ),  # 1
    (2, TType.BOOL, 'enableOperationSync', None, None, ),  # 2
    (3, TType.STRING, 'secondaryAddress', 'UTF8', None, ),  # 3
    (4, TType.I32, 'secondaryPort', None, None, ),  # 4
)
all_structs.append(TSConnectionInfo)
TSConnectionInfo.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'userName', 'UTF8', None, ),  # 1
    (2, TType.I64, 'logInTime', None, None, ),  # 2
    (3, TType.STRING, 'connectionId', 'UTF8', None, ),  # 3
    (4, TType.I32, 'type', None, None, ),  # 4
)
all_structs.append(TSConnectionInfoResp)
TSConnectionInfoResp.thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'connectionInfoList', (TType.STRUCT, [TSConnectionInfo, None], False), None, ),  # 1
)
fix_spec(all_structs)
del all_structs
