http://git-wip-us.apache.org/repos/asf/hive/blob/1d46608e/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py index 11affe3..ccca4e9 100644 --- a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -305,6 +305,23 @@ class SchemaVersionState: "DELETED": 8, } +class IsolationLevelCompliance: + YES = 1 + NO = 2 + UNKNOWN = 3 + + _VALUES_TO_NAMES = { + 1: "YES", + 2: "NO", + 3: "UNKNOWN", + } + + _NAMES_TO_VALUES = { + "YES": 1, + "NO": 2, + "UNKNOWN": 3, + } + class FunctionType: JAVA = 1 @@ -4550,6 +4567,9 @@ class Table: - creationMetadata - catName - ownerType + - txnId + - validWriteIdList + - isStatsCompliant """ thrift_spec = ( @@ -4572,9 +4592,12 @@ class Table: (16, TType.STRUCT, 'creationMetadata', (CreationMetadata, CreationMetadata.thrift_spec), None, ), # 16 (17, TType.STRING, 'catName', None, None, ), # 17 (18, TType.I32, 'ownerType', None, 1, ), # 18 + (19, TType.I64, 'txnId', None, -1, ), # 19 + (20, TType.STRING, 'validWriteIdList', None, None, ), # 20 + (21, TType.I32, 'isStatsCompliant', None, None, ), # 21 ) - def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None, tableType=None, privileges=None, temporary=thrift_spec[14][4], rewriteEnabled=None, creationMetadata=None, catName=None, ownerType=thrift_spec[18][4],): + def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None, tableType=None, privileges=None, temporary=thrift_spec[14][4], rewriteEnabled=None, creationMetadata=None, catName=None, ownerType=thrift_spec[18][4], txnId=thrift_spec[19][4], validWriteIdList=None, isStatsCompliant=None,): self.tableName = tableName self.dbName = dbName self.owner = owner @@ -4593,6 +4616,9 @@ class Table: self.creationMetadata = creationMetadata self.catName = catName self.ownerType = ownerType + self.txnId = txnId + self.validWriteIdList = validWriteIdList + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -4708,6 +4734,21 @@ class Table: self.ownerType = iprot.readI32() else: iprot.skip(ftype) + elif fid == 19: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 20: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 21: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -4797,6 +4838,18 @@ class Table: oprot.writeFieldBegin('ownerType', TType.I32, 18) oprot.writeI32(self.ownerType) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 19) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 20) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 21) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -4824,6 +4877,9 @@ class Table: value = (value * 31) ^ hash(self.creationMetadata) value = (value * 31) ^ hash(self.catName) value = (value * 31) ^ hash(self.ownerType) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -4849,6 +4905,9 @@ class Partition: - parameters - privileges - catName + - txnId + - validWriteIdList + - isStatsCompliant """ thrift_spec = ( @@ -4862,9 +4921,12 @@ class Partition: (7, TType.MAP, 'parameters', (TType.STRING,None,TType.STRING,None), None, ), # 7 (8, TType.STRUCT, 'privileges', (PrincipalPrivilegeSet, PrincipalPrivilegeSet.thrift_spec), None, ), # 8 (9, TType.STRING, 'catName', None, None, ), # 9 + (10, TType.I64, 'txnId', None, -1, ), # 10 + (11, TType.STRING, 'validWriteIdList', None, None, ), # 11 + (12, TType.I32, 'isStatsCompliant', None, None, ), # 12 ) - def __init__(self, values=None, dbName=None, tableName=None, createTime=None, lastAccessTime=None, sd=None, parameters=None, privileges=None, catName=None,): + def __init__(self, values=None, dbName=None, tableName=None, createTime=None, lastAccessTime=None, sd=None, parameters=None, privileges=None, catName=None, txnId=thrift_spec[10][4], validWriteIdList=None, isStatsCompliant=None,): self.values = values self.dbName = dbName self.tableName = tableName @@ -4874,6 +4936,9 @@ class Partition: self.parameters = parameters self.privileges = privileges self.catName = catName + self.txnId = txnId + self.validWriteIdList = validWriteIdList + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -4942,6 +5007,21 @@ class Partition: self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 10: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 11: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 12: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -4995,6 +5075,18 @@ class Partition: oprot.writeFieldBegin('catName', TType.STRING, 9) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 10) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 11) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 12) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5013,6 +5105,9 @@ class Partition: value = (value * 31) ^ hash(self.parameters) value = (value * 31) ^ hash(self.privileges) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -5346,6 +5441,9 @@ class PartitionSpec: - sharedSDPartitionSpec - partitionList - catName + - txnId + - validWriteIdList + - isStatsCompliant """ thrift_spec = ( @@ -5356,15 +5454,21 @@ class PartitionSpec: (4, TType.STRUCT, 'sharedSDPartitionSpec', (PartitionSpecWithSharedSD, PartitionSpecWithSharedSD.thrift_spec), None, ), # 4 (5, TType.STRUCT, 'partitionList', (PartitionListComposingSpec, PartitionListComposingSpec.thrift_spec), None, ), # 5 (6, TType.STRING, 'catName', None, None, ), # 6 + (7, TType.I64, 'txnId', None, -1, ), # 7 + (8, TType.STRING, 'validWriteIdList', None, None, ), # 8 + (9, TType.I32, 'isStatsCompliant', None, None, ), # 9 ) - def __init__(self, dbName=None, tableName=None, rootPath=None, sharedSDPartitionSpec=None, partitionList=None, catName=None,): + def __init__(self, dbName=None, tableName=None, rootPath=None, sharedSDPartitionSpec=None, partitionList=None, catName=None, txnId=thrift_spec[7][4], validWriteIdList=None, isStatsCompliant=None,): self.dbName = dbName self.tableName = tableName self.rootPath = rootPath self.sharedSDPartitionSpec = sharedSDPartitionSpec self.partitionList = partitionList self.catName = catName + self.txnId = txnId + self.validWriteIdList = validWriteIdList + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -5407,6 +5511,21 @@ class PartitionSpec: self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 7: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -5441,6 +5560,18 @@ class PartitionSpec: oprot.writeFieldBegin('catName', TType.STRING, 6) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 7) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 8) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 9) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -5456,6 +5587,9 @@ class PartitionSpec: value = (value * 31) ^ hash(self.sharedSDPartitionSpec) value = (value * 31) ^ hash(self.partitionList) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -6841,17 +6975,26 @@ class ColumnStatistics: Attributes: - statsDesc - statsObj + - txnId + - validWriteIdList + - isStatsCompliant """ thrift_spec = ( None, # 0 (1, TType.STRUCT, 'statsDesc', (ColumnStatisticsDesc, ColumnStatisticsDesc.thrift_spec), None, ), # 1 (2, TType.LIST, 'statsObj', (TType.STRUCT,(ColumnStatisticsObj, ColumnStatisticsObj.thrift_spec)), None, ), # 2 + (3, TType.I64, 'txnId', None, -1, ), # 3 + (4, TType.STRING, 'validWriteIdList', None, None, ), # 4 + (5, TType.I32, 'isStatsCompliant', None, None, ), # 5 ) - def __init__(self, statsDesc=None, statsObj=None,): + def __init__(self, statsDesc=None, statsObj=None, txnId=thrift_spec[3][4], validWriteIdList=None, isStatsCompliant=None,): self.statsDesc = statsDesc self.statsObj = statsObj + self.txnId = txnId + self.validWriteIdList = validWriteIdList + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -6879,6 +7022,21 @@ class ColumnStatistics: iprot.readListEnd() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -6900,6 +7058,18 @@ class ColumnStatistics: iter243.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 3) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 4) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 5) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -6915,6 +7085,9 @@ class ColumnStatistics: value = 17 value = (value * 31) ^ hash(self.statsDesc) value = (value * 31) ^ hash(self.statsObj) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -6933,17 +7106,20 @@ class AggrStats: Attributes: - colStats - partsFound + - isStatsCompliant """ thrift_spec = ( None, # 0 (1, TType.LIST, 'colStats', (TType.STRUCT,(ColumnStatisticsObj, ColumnStatisticsObj.thrift_spec)), None, ), # 1 (2, TType.I64, 'partsFound', None, None, ), # 2 + (3, TType.I32, 'isStatsCompliant', None, None, ), # 3 ) - def __init__(self, colStats=None, partsFound=None,): + def __init__(self, colStats=None, partsFound=None, isStatsCompliant=None,): self.colStats = colStats self.partsFound = partsFound + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -6970,6 +7146,11 @@ class AggrStats: self.partsFound = iprot.readI64() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -6991,6 +7172,10 @@ class AggrStats: oprot.writeFieldBegin('partsFound', TType.I64, 2) oprot.writeI64(self.partsFound) oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 3) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -7006,6 +7191,7 @@ class AggrStats: value = 17 value = (value * 31) ^ hash(self.colStats) value = (value * 31) ^ hash(self.partsFound) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -7024,17 +7210,23 @@ class SetPartitionsStatsRequest: Attributes: - colStats - needMerge + - txnId + - validWriteIdList """ thrift_spec = ( None, # 0 (1, TType.LIST, 'colStats', (TType.STRUCT,(ColumnStatistics, ColumnStatistics.thrift_spec)), None, ), # 1 (2, TType.BOOL, 'needMerge', None, None, ), # 2 + (3, TType.I64, 'txnId', None, -1, ), # 3 + (4, TType.STRING, 'validWriteIdList', None, None, ), # 4 ) - def __init__(self, colStats=None, needMerge=None,): + def __init__(self, colStats=None, needMerge=None, txnId=thrift_spec[3][4], validWriteIdList=None,): self.colStats = colStats self.needMerge = needMerge + self.txnId = txnId + self.validWriteIdList = validWriteIdList def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -7061,6 +7253,16 @@ class SetPartitionsStatsRequest: self.needMerge = iprot.readBool() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -7082,6 +7284,14 @@ class SetPartitionsStatsRequest: oprot.writeFieldBegin('needMerge', TType.BOOL, 2) oprot.writeBool(self.needMerge) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 3) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 4) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -7095,6 +7305,8 @@ class SetPartitionsStatsRequest: value = 17 value = (value * 31) ^ hash(self.colStats) value = (value * 31) ^ hash(self.needMerge) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -9133,15 +9345,18 @@ class TableStatsResult: """ Attributes: - tableStats + - isStatsCompliant """ thrift_spec = ( None, # 0 (1, TType.LIST, 'tableStats', (TType.STRUCT,(ColumnStatisticsObj, ColumnStatisticsObj.thrift_spec)), None, ), # 1 + (2, TType.I32, 'isStatsCompliant', None, None, ), # 2 ) - def __init__(self, tableStats=None,): + def __init__(self, tableStats=None, isStatsCompliant=None,): self.tableStats = tableStats + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -9163,6 +9378,11 @@ class TableStatsResult: iprot.readListEnd() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9180,6 +9400,10 @@ class TableStatsResult: iter380.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 2) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9192,6 +9416,7 @@ class TableStatsResult: def __hash__(self): value = 17 value = (value * 31) ^ hash(self.tableStats) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -9209,15 +9434,18 @@ class PartitionsStatsResult: """ Attributes: - partStats + - isStatsCompliant """ thrift_spec = ( None, # 0 (1, TType.MAP, 'partStats', (TType.STRING,None,TType.LIST,(TType.STRUCT,(ColumnStatisticsObj, ColumnStatisticsObj.thrift_spec))), None, ), # 1 + (2, TType.I32, 'isStatsCompliant', None, None, ), # 2 ) - def __init__(self, partStats=None,): + def __init__(self, partStats=None, isStatsCompliant=None,): self.partStats = partStats + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -9245,6 +9473,11 @@ class PartitionsStatsResult: iprot.readMapEnd() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9266,6 +9499,10 @@ class PartitionsStatsResult: oprot.writeListEnd() oprot.writeMapEnd() oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 2) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9278,6 +9515,7 @@ class PartitionsStatsResult: def __hash__(self): value = 17 value = (value * 31) ^ hash(self.partStats) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -9298,6 +9536,8 @@ class TableStatsRequest: - tblName - colNames - catName + - txnId + - validWriteIdList """ thrift_spec = ( @@ -9306,13 +9546,17 @@ class TableStatsRequest: (2, TType.STRING, 'tblName', None, None, ), # 2 (3, TType.LIST, 'colNames', (TType.STRING,None), None, ), # 3 (4, TType.STRING, 'catName', None, None, ), # 4 + (5, TType.I64, 'txnId', None, -1, ), # 5 + (6, TType.STRING, 'validWriteIdList', None, None, ), # 6 ) - def __init__(self, dbName=None, tblName=None, colNames=None, catName=None,): + def __init__(self, dbName=None, tblName=None, colNames=None, catName=None, txnId=thrift_spec[5][4], validWriteIdList=None,): self.dbName = dbName self.tblName = tblName self.colNames = colNames self.catName = catName + self.txnId = txnId + self.validWriteIdList = validWriteIdList def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -9348,6 +9592,16 @@ class TableStatsRequest: self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9377,6 +9631,14 @@ class TableStatsRequest: oprot.writeFieldBegin('catName', TType.STRING, 4) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 5) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 6) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9396,6 +9658,8 @@ class TableStatsRequest: value = (value * 31) ^ hash(self.tblName) value = (value * 31) ^ hash(self.colNames) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -9417,6 +9681,8 @@ class PartitionsStatsRequest: - colNames - partNames - catName + - txnId + - validWriteIdList """ thrift_spec = ( @@ -9426,14 +9692,18 @@ class PartitionsStatsRequest: (3, TType.LIST, 'colNames', (TType.STRING,None), None, ), # 3 (4, TType.LIST, 'partNames', (TType.STRING,None), None, ), # 4 (5, TType.STRING, 'catName', None, None, ), # 5 + (6, TType.I64, 'txnId', None, -1, ), # 6 + (7, TType.STRING, 'validWriteIdList', None, None, ), # 7 ) - def __init__(self, dbName=None, tblName=None, colNames=None, partNames=None, catName=None,): + def __init__(self, dbName=None, tblName=None, colNames=None, partNames=None, catName=None, txnId=thrift_spec[6][4], validWriteIdList=None,): self.dbName = dbName self.tblName = tblName self.colNames = colNames self.partNames = partNames self.catName = catName + self.txnId = txnId + self.validWriteIdList = validWriteIdList def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -9479,6 +9749,16 @@ class PartitionsStatsRequest: self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9515,6 +9795,14 @@ class PartitionsStatsRequest: oprot.writeFieldBegin('catName', TType.STRING, 5) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 6) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 7) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9537,6 +9825,8 @@ class PartitionsStatsRequest: value = (value * 31) ^ hash(self.colNames) value = (value * 31) ^ hash(self.partNames) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -9554,15 +9844,18 @@ class AddPartitionsResult: """ Attributes: - partitions + - isStatsCompliant """ thrift_spec = ( None, # 0 (1, TType.LIST, 'partitions', (TType.STRUCT,(Partition, Partition.thrift_spec)), None, ), # 1 + (2, TType.I32, 'isStatsCompliant', None, None, ), # 2 ) - def __init__(self, partitions=None,): + def __init__(self, partitions=None, isStatsCompliant=None,): self.partitions = partitions + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -9584,6 +9877,11 @@ class AddPartitionsResult: iprot.readListEnd() else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9601,6 +9899,10 @@ class AddPartitionsResult: iter424.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 2) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9611,6 +9913,7 @@ class AddPartitionsResult: def __hash__(self): value = 17 value = (value * 31) ^ hash(self.partitions) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -9633,6 +9936,8 @@ class AddPartitionsRequest: - ifNotExists - needResult - catName + - txnId + - validWriteIdList """ thrift_spec = ( @@ -9643,15 +9948,19 @@ class AddPartitionsRequest: (4, TType.BOOL, 'ifNotExists', None, None, ), # 4 (5, TType.BOOL, 'needResult', None, True, ), # 5 (6, TType.STRING, 'catName', None, None, ), # 6 + (7, TType.I64, 'txnId', None, -1, ), # 7 + (8, TType.STRING, 'validWriteIdList', None, None, ), # 8 ) - def __init__(self, dbName=None, tblName=None, parts=None, ifNotExists=None, needResult=thrift_spec[5][4], catName=None,): + def __init__(self, dbName=None, tblName=None, parts=None, ifNotExists=None, needResult=thrift_spec[5][4], catName=None, txnId=thrift_spec[7][4], validWriteIdList=None,): self.dbName = dbName self.tblName = tblName self.parts = parts self.ifNotExists = ifNotExists self.needResult = needResult self.catName = catName + self.txnId = txnId + self.validWriteIdList = validWriteIdList def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -9698,6 +10007,16 @@ class AddPartitionsRequest: self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 7: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -9735,6 +10054,14 @@ class AddPartitionsRequest: oprot.writeFieldBegin('catName', TType.STRING, 6) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 7) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 8) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -9758,6 +10085,8 @@ class AddPartitionsRequest: value = (value * 31) ^ hash(self.ifNotExists) value = (value * 31) ^ hash(self.needResult) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -16609,6 +16938,8 @@ class GetTableRequest: - tblName - capabilities - catName + - txnId + - validWriteIdList """ thrift_spec = ( @@ -16617,13 +16948,17 @@ class GetTableRequest: (2, TType.STRING, 'tblName', None, None, ), # 2 (3, TType.STRUCT, 'capabilities', (ClientCapabilities, ClientCapabilities.thrift_spec), None, ), # 3 (4, TType.STRING, 'catName', None, None, ), # 4 + (5, TType.I64, 'txnId', None, -1, ), # 5 + (6, TType.STRING, 'validWriteIdList', None, None, ), # 6 ) - def __init__(self, dbName=None, tblName=None, capabilities=None, catName=None,): + def __init__(self, dbName=None, tblName=None, capabilities=None, catName=None, txnId=thrift_spec[5][4], validWriteIdList=None,): self.dbName = dbName self.tblName = tblName self.capabilities = capabilities self.catName = catName + self.txnId = txnId + self.validWriteIdList = validWriteIdList def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -16655,6 +16990,16 @@ class GetTableRequest: self.catName = iprot.readString() else: iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -16681,6 +17026,14 @@ class GetTableRequest: oprot.writeFieldBegin('catName', TType.STRING, 4) oprot.writeString(self.catName) oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 5) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 6) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -16698,6 +17051,8 @@ class GetTableRequest: value = (value * 31) ^ hash(self.tblName) value = (value * 31) ^ hash(self.capabilities) value = (value * 31) ^ hash(self.catName) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) return value def __repr__(self): @@ -16715,15 +17070,18 @@ class GetTableResult: """ Attributes: - table + - isStatsCompliant """ thrift_spec = ( None, # 0 (1, TType.STRUCT, 'table', (Table, Table.thrift_spec), None, ), # 1 + (2, TType.I32, 'isStatsCompliant', None, None, ), # 2 ) - def __init__(self, table=None,): + def __init__(self, table=None, isStatsCompliant=None,): self.table = table + self.isStatsCompliant = isStatsCompliant def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -16740,6 +17098,11 @@ class GetTableResult: self.table.read(iprot) else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.isStatsCompliant = iprot.readI32() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -16754,6 +17117,10 @@ class GetTableResult: oprot.writeFieldBegin('table', TType.STRUCT, 1) self.table.write(oprot) oprot.writeFieldEnd() + if self.isStatsCompliant is not None: + oprot.writeFieldBegin('isStatsCompliant', TType.I32, 2) + oprot.writeI32(self.isStatsCompliant) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -16766,6 +17133,7 @@ class GetTableResult: def __hash__(self): value = 17 value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.isStatsCompliant) return value def __repr__(self): @@ -21666,6 +22034,200 @@ class GetRuntimeStatsRequest: def __ne__(self, other): return not (self == other) +class AlterPartitionsRequest: + """ + Attributes: + - dbName + - tableName + - partitions + - environmentContext + - txnId + - validWriteIdList + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'dbName', None, None, ), # 1 + (2, TType.STRING, 'tableName', None, None, ), # 2 + (3, TType.LIST, 'partitions', (TType.STRUCT,(Partition, Partition.thrift_spec)), None, ), # 3 + (4, TType.STRUCT, 'environmentContext', (EnvironmentContext, EnvironmentContext.thrift_spec), None, ), # 4 + (5, TType.I64, 'txnId', None, -1, ), # 5 + (6, TType.STRING, 'validWriteIdList', None, None, ), # 6 + ) + + def __init__(self, dbName=None, tableName=None, partitions=None, environmentContext=None, txnId=thrift_spec[5][4], validWriteIdList=None,): + self.dbName = dbName + self.tableName = tableName + self.partitions = partitions + self.environmentContext = environmentContext + self.txnId = txnId + self.validWriteIdList = validWriteIdList + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.dbName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.tableName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.partitions = [] + (_etype819, _size816) = iprot.readListBegin() + for _i820 in xrange(_size816): + _elem821 = Partition() + _elem821.read(iprot) + self.partitions.append(_elem821) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.environmentContext = EnvironmentContext() + self.environmentContext.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.txnId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.validWriteIdList = iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('AlterPartitionsRequest') + if self.dbName is not None: + oprot.writeFieldBegin('dbName', TType.STRING, 1) + oprot.writeString(self.dbName) + oprot.writeFieldEnd() + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 2) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.partitions is not None: + oprot.writeFieldBegin('partitions', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.partitions)) + for iter822 in self.partitions: + iter822.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.environmentContext is not None: + oprot.writeFieldBegin('environmentContext', TType.STRUCT, 4) + self.environmentContext.write(oprot) + oprot.writeFieldEnd() + if self.txnId is not None: + oprot.writeFieldBegin('txnId', TType.I64, 5) + oprot.writeI64(self.txnId) + oprot.writeFieldEnd() + if self.validWriteIdList is not None: + oprot.writeFieldBegin('validWriteIdList', TType.STRING, 6) + oprot.writeString(self.validWriteIdList) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.dbName is None: + raise TProtocol.TProtocolException(message='Required field dbName is unset!') + if self.tableName is None: + raise TProtocol.TProtocolException(message='Required field tableName is unset!') + if self.partitions is None: + raise TProtocol.TProtocolException(message='Required field partitions is unset!') + if self.environmentContext is None: + raise TProtocol.TProtocolException(message='Required field environmentContext is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.dbName) + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.partitions) + value = (value * 31) ^ hash(self.environmentContext) + value = (value * 31) ^ hash(self.txnId) + value = (value * 31) ^ hash(self.validWriteIdList) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class AlterPartitionsResponse: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('AlterPartitionsResponse') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class MetaException(TException): """ Attributes:
http://git-wip-us.apache.org/repos/asf/hive/blob/1d46608e/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb b/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb index fc640d0..7b5132c 100644 --- a/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb +++ b/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb @@ -141,6 +141,14 @@ module SchemaVersionState VALID_VALUES = Set.new([INITIATED, START_REVIEW, CHANGES_REQUIRED, REVIEWED, ENABLED, DISABLED, ARCHIVED, DELETED]).freeze end +module IsolationLevelCompliance + YES = 1 + NO = 2 + UNKNOWN = 3 + VALUE_MAP = {1 => "YES", 2 => "NO", 3 => "UNKNOWN"} + VALID_VALUES = Set.new([YES, NO, UNKNOWN]).freeze +end + module FunctionType JAVA = 1 VALUE_MAP = {1 => "JAVA"} @@ -1062,6 +1070,9 @@ class Table CREATIONMETADATA = 16 CATNAME = 17 OWNERTYPE = 18 + TXNID = 19 + VALIDWRITEIDLIST = 20 + ISSTATSCOMPLIANT = 21 FIELDS = { TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, @@ -1081,7 +1092,10 @@ class Table REWRITEENABLED => {:type => ::Thrift::Types::BOOL, :name => 'rewriteEnabled', :optional => true}, CREATIONMETADATA => {:type => ::Thrift::Types::STRUCT, :name => 'creationMetadata', :class => ::CreationMetadata, :optional => true}, CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, - OWNERTYPE => {:type => ::Thrift::Types::I32, :name => 'ownerType', :default => 1, :optional => true, :enum_class => ::PrincipalType} + OWNERTYPE => {:type => ::Thrift::Types::I32, :name => 'ownerType', :default => 1, :optional => true, :enum_class => ::PrincipalType}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end @@ -1090,6 +1104,9 @@ class Table unless @ownerType.nil? || ::PrincipalType::VALID_VALUES.include?(@ownerType) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field ownerType!') end + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -1106,6 +1123,9 @@ class Partition PARAMETERS = 7 PRIVILEGES = 8 CATNAME = 9 + TXNID = 10 + VALIDWRITEIDLIST = 11 + ISSTATSCOMPLIANT = 12 FIELDS = { VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}}, @@ -1116,12 +1136,18 @@ class Partition SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => ::StorageDescriptor}, PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}, PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => ::PrincipalPrivilegeSet, :optional => true}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end def validate + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -1195,6 +1221,9 @@ class PartitionSpec SHAREDSDPARTITIONSPEC = 4 PARTITIONLIST = 5 CATNAME = 6 + TXNID = 7 + VALIDWRITEIDLIST = 8 + ISSTATSCOMPLIANT = 9 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, @@ -1202,12 +1231,18 @@ class PartitionSpec ROOTPATH => {:type => ::Thrift::Types::STRING, :name => 'rootPath'}, SHAREDSDPARTITIONSPEC => {:type => ::Thrift::Types::STRUCT, :name => 'sharedSDPartitionSpec', :class => ::PartitionSpecWithSharedSD, :optional => true}, PARTITIONLIST => {:type => ::Thrift::Types::STRUCT, :name => 'partitionList', :class => ::PartitionListComposingSpec, :optional => true}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end def validate + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -1547,10 +1582,16 @@ class ColumnStatistics include ::Thrift::Struct, ::Thrift::Struct_Union STATSDESC = 1 STATSOBJ = 2 + TXNID = 3 + VALIDWRITEIDLIST = 4 + ISSTATSCOMPLIANT = 5 FIELDS = { STATSDESC => {:type => ::Thrift::Types::STRUCT, :name => 'statsDesc', :class => ::ColumnStatisticsDesc}, - STATSOBJ => {:type => ::Thrift::Types::LIST, :name => 'statsObj', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}} + STATSOBJ => {:type => ::Thrift::Types::LIST, :name => 'statsObj', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end @@ -1558,6 +1599,9 @@ class ColumnStatistics def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field statsDesc is unset!') unless @statsDesc raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field statsObj is unset!') unless @statsObj + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -1567,10 +1611,12 @@ class AggrStats include ::Thrift::Struct, ::Thrift::Struct_Union COLSTATS = 1 PARTSFOUND = 2 + ISSTATSCOMPLIANT = 3 FIELDS = { COLSTATS => {:type => ::Thrift::Types::LIST, :name => 'colStats', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}}, - PARTSFOUND => {:type => ::Thrift::Types::I64, :name => 'partsFound'} + PARTSFOUND => {:type => ::Thrift::Types::I64, :name => 'partsFound'}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end @@ -1578,6 +1624,9 @@ class AggrStats def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field colStats is unset!') unless @colStats raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field partsFound is unset!') unless @partsFound + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -1587,10 +1636,14 @@ class SetPartitionsStatsRequest include ::Thrift::Struct, ::Thrift::Struct_Union COLSTATS = 1 NEEDMERGE = 2 + TXNID = 3 + VALIDWRITEIDLIST = 4 FIELDS = { COLSTATS => {:type => ::Thrift::Types::LIST, :name => 'colStats', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatistics}}, - NEEDMERGE => {:type => ::Thrift::Types::BOOL, :name => 'needMerge', :optional => true} + NEEDMERGE => {:type => ::Thrift::Types::BOOL, :name => 'needMerge', :optional => true}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -2055,15 +2108,20 @@ end class TableStatsResult include ::Thrift::Struct, ::Thrift::Struct_Union TABLESTATS = 1 + ISSTATSCOMPLIANT = 2 FIELDS = { - TABLESTATS => {:type => ::Thrift::Types::LIST, :name => 'tableStats', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}} + TABLESTATS => {:type => ::Thrift::Types::LIST, :name => 'tableStats', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field tableStats is unset!') unless @tableStats + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -2072,15 +2130,20 @@ end class PartitionsStatsResult include ::Thrift::Struct, ::Thrift::Struct_Union PARTSTATS = 1 + ISSTATSCOMPLIANT = 2 FIELDS = { - PARTSTATS => {:type => ::Thrift::Types::MAP, :name => 'partStats', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}}} + PARTSTATS => {:type => ::Thrift::Types::MAP, :name => 'partStats', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => ::ColumnStatisticsObj}}}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field partStats is unset!') unless @partStats + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -2092,12 +2155,16 @@ class TableStatsRequest TBLNAME = 2 COLNAMES = 3 CATNAME = 4 + TXNID = 5 + VALIDWRITEIDLIST = 6 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TBLNAME => {:type => ::Thrift::Types::STRING, :name => 'tblName'}, COLNAMES => {:type => ::Thrift::Types::LIST, :name => 'colNames', :element => {:type => ::Thrift::Types::STRING}}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -2118,13 +2185,17 @@ class PartitionsStatsRequest COLNAMES = 3 PARTNAMES = 4 CATNAME = 5 + TXNID = 6 + VALIDWRITEIDLIST = 7 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TBLNAME => {:type => ::Thrift::Types::STRING, :name => 'tblName'}, COLNAMES => {:type => ::Thrift::Types::LIST, :name => 'colNames', :element => {:type => ::Thrift::Types::STRING}}, PARTNAMES => {:type => ::Thrift::Types::LIST, :name => 'partNames', :element => {:type => ::Thrift::Types::STRING}}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -2142,14 +2213,19 @@ end class AddPartitionsResult include ::Thrift::Struct, ::Thrift::Struct_Union PARTITIONS = 1 + ISSTATSCOMPLIANT = 2 FIELDS = { - PARTITIONS => {:type => ::Thrift::Types::LIST, :name => 'partitions', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Partition}, :optional => true} + PARTITIONS => {:type => ::Thrift::Types::LIST, :name => 'partitions', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Partition}, :optional => true}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end def validate + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -2163,6 +2239,8 @@ class AddPartitionsRequest IFNOTEXISTS = 4 NEEDRESULT = 5 CATNAME = 6 + TXNID = 7 + VALIDWRITEIDLIST = 8 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, @@ -2170,7 +2248,9 @@ class AddPartitionsRequest PARTS => {:type => ::Thrift::Types::LIST, :name => 'parts', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Partition}}, IFNOTEXISTS => {:type => ::Thrift::Types::BOOL, :name => 'ifNotExists'}, NEEDRESULT => {:type => ::Thrift::Types::BOOL, :name => 'needResult', :default => true, :optional => true}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -3731,12 +3811,16 @@ class GetTableRequest TBLNAME = 2 CAPABILITIES = 3 CATNAME = 4 + TXNID = 5 + VALIDWRITEIDLIST = 6 FIELDS = { DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, TBLNAME => {:type => ::Thrift::Types::STRING, :name => 'tblName'}, CAPABILITIES => {:type => ::Thrift::Types::STRUCT, :name => 'capabilities', :class => ::ClientCapabilities, :optional => true}, - CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true} + CATNAME => {:type => ::Thrift::Types::STRING, :name => 'catName', :optional => true}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} } def struct_fields; FIELDS; end @@ -3752,15 +3836,20 @@ end class GetTableResult include ::Thrift::Struct, ::Thrift::Struct_Union TABLE = 1 + ISSTATSCOMPLIANT = 2 FIELDS = { - TABLE => {:type => ::Thrift::Types::STRUCT, :name => 'table', :class => ::Table} + TABLE => {:type => ::Thrift::Types::STRUCT, :name => 'table', :class => ::Table}, + ISSTATSCOMPLIANT => {:type => ::Thrift::Types::I32, :name => 'isStatsCompliant', :optional => true, :enum_class => ::IsolationLevelCompliance} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field table is unset!') unless @table + unless @isStatsCompliant.nil? || ::IsolationLevelCompliance::VALID_VALUES.include?(@isStatsCompliant) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field isStatsCompliant!') + end end ::Thrift::Struct.generate_accessors self @@ -4923,6 +5012,51 @@ class GetRuntimeStatsRequest ::Thrift::Struct.generate_accessors self end +class AlterPartitionsRequest + include ::Thrift::Struct, ::Thrift::Struct_Union + DBNAME = 1 + TABLENAME = 2 + PARTITIONS = 3 + ENVIRONMENTCONTEXT = 4 + TXNID = 5 + VALIDWRITEIDLIST = 6 + + FIELDS = { + DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'}, + TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'}, + PARTITIONS => {:type => ::Thrift::Types::LIST, :name => 'partitions', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Partition}}, + ENVIRONMENTCONTEXT => {:type => ::Thrift::Types::STRUCT, :name => 'environmentContext', :class => ::EnvironmentContext}, + TXNID => {:type => ::Thrift::Types::I64, :name => 'txnId', :default => -1, :optional => true}, + VALIDWRITEIDLIST => {:type => ::Thrift::Types::STRING, :name => 'validWriteIdList', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field dbName is unset!') unless @dbName + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field tableName is unset!') unless @tableName + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field partitions is unset!') unless @partitions + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field environmentContext is unset!') unless @environmentContext + end + + ::Thrift::Struct.generate_accessors self +end + +class AlterPartitionsResponse + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + class MetaException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) http://git-wip-us.apache.org/repos/asf/hive/blob/1d46608e/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb b/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb index bbf3f12..3987ee9 100644 --- a/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb +++ b/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb @@ -1416,20 +1416,21 @@ module ThriftHiveMetastore return end - def alter_partitions_with_environment_context(db_name, tbl_name, new_parts, environment_context) - send_alter_partitions_with_environment_context(db_name, tbl_name, new_parts, environment_context) - recv_alter_partitions_with_environment_context() + def alter_partitions_with_environment_context(req) + send_alter_partitions_with_environment_context(req) + return recv_alter_partitions_with_environment_context() end - def send_alter_partitions_with_environment_context(db_name, tbl_name, new_parts, environment_context) - send_message('alter_partitions_with_environment_context', Alter_partitions_with_environment_context_args, :db_name => db_name, :tbl_name => tbl_name, :new_parts => new_parts, :environment_context => environment_context) + def send_alter_partitions_with_environment_context(req) + send_message('alter_partitions_with_environment_context', Alter_partitions_with_environment_context_args, :req => req) end def recv_alter_partitions_with_environment_context() result = receive_message(Alter_partitions_with_environment_context_result) + return result.success unless result.success.nil? raise result.o1 unless result.o1.nil? raise result.o2 unless result.o2.nil? - return + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'alter_partitions_with_environment_context failed: unknown result') end def alter_partition_with_environment_context(db_name, tbl_name, new_part, environment_context) @@ -4580,7 +4581,7 @@ module ThriftHiveMetastore args = read_args(iprot, Alter_partitions_with_environment_context_args) result = Alter_partitions_with_environment_context_result.new() begin - @handler.alter_partitions_with_environment_context(args.db_name, args.tbl_name, args.new_parts, args.environment_context) + result.success = @handler.alter_partitions_with_environment_context(args.req) rescue ::InvalidOperationException => o1 result.o1 = o1 rescue ::MetaException => o2 @@ -9272,16 +9273,10 @@ module ThriftHiveMetastore class Alter_partitions_with_environment_context_args include ::Thrift::Struct, ::Thrift::Struct_Union - DB_NAME = 1 - TBL_NAME = 2 - NEW_PARTS = 3 - ENVIRONMENT_CONTEXT = 4 + REQ = 1 FIELDS = { - DB_NAME => {:type => ::Thrift::Types::STRING, :name => 'db_name'}, - TBL_NAME => {:type => ::Thrift::Types::STRING, :name => 'tbl_name'}, - NEW_PARTS => {:type => ::Thrift::Types::LIST, :name => 'new_parts', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Partition}}, - ENVIRONMENT_CONTEXT => {:type => ::Thrift::Types::STRUCT, :name => 'environment_context', :class => ::EnvironmentContext} + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::AlterPartitionsRequest} } def struct_fields; FIELDS; end @@ -9294,10 +9289,12 @@ module ThriftHiveMetastore class Alter_partitions_with_environment_context_result include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 O1 = 1 O2 = 2 FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::AlterPartitionsResponse}, O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => ::InvalidOperationException}, O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => ::MetaException} } http://git-wip-us.apache.org/repos/asf/hive/blob/1d46608e/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/AlterHandler.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/AlterHandler.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/AlterHandler.java index 050dca9..010870d 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/AlterHandler.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/AlterHandler.java @@ -197,6 +197,6 @@ public interface AlterHandler extends Configurable { */ List<Partition> alterPartitions(final RawStore msdb, Warehouse wh, final String catName, final String dbname, final String name, final List<Partition> new_parts, - EnvironmentContext environmentContext,IHMSHandler handler) + EnvironmentContext environmentContext, long txnId, String writeIdList, IHMSHandler handler) throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hive/blob/1d46608e/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java index c2da6d3..5b70307 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java @@ -144,7 +144,7 @@ public class HiveAlterHandler implements AlterHandler { // check if table with the new name already exists if (!newTblName.equals(name) || !newDbName.equals(dbname)) { - if (msdb.getTable(catName, newDbName, newTblName) != null) { + if (msdb.getTable(catName, newDbName, newTblName, -1, null) != null) { throw new InvalidOperationException("new table " + newDbName + "." + newTblName + " already exists"); } @@ -153,7 +153,7 @@ public class HiveAlterHandler implements AlterHandler { msdb.openTransaction(); // get old table - oldt = msdb.getTable(catName, dbname, name); + oldt = msdb.getTable(catName, dbname, name, -1, null); if (oldt == null) { throw new InvalidOperationException("table " + TableName.getQualified(catName, dbname, name) + " doesn't exist"); @@ -296,7 +296,8 @@ public class HiveAlterHandler implements AlterHandler { for (Partition part : partBatch) { partValues.add(part.getValues()); } - msdb.alterPartitions(catName, newDbName, newTblName, partValues, partBatch); + msdb.alterPartitions( + catName, newDbName, newTblName, partValues, partBatch, -1, null); } } @@ -453,7 +454,7 @@ public class HiveAlterHandler implements AlterHandler { try { msdb.openTransaction(); - Table tbl = msdb.getTable(catName, dbname, name); + Table tbl = msdb.getTable(catName, dbname, name, -1, null); if (tbl == null) { throw new InvalidObjectException( "Unable to alter partition because table or database does not exist."); @@ -509,7 +510,7 @@ public class HiveAlterHandler implements AlterHandler { Database db; try { msdb.openTransaction(); - Table tbl = msdb.getTable(DEFAULT_CATALOG_NAME, dbname, name); + Table tbl = msdb.getTable(DEFAULT_CATALOG_NAME, dbname, name, -1, null); if (tbl == null) { throw new InvalidObjectException( "Unable to alter partition because table or database does not exist."); @@ -658,14 +659,15 @@ public class HiveAlterHandler implements AlterHandler { EnvironmentContext environmentContext) throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException { return alterPartitions(msdb, wh, DEFAULT_CATALOG_NAME, dbname, name, new_parts, - environmentContext, null); + environmentContext, -1, null, null); } @Override public List<Partition> alterPartitions(final RawStore msdb, Warehouse wh, final String catName, final String dbname, final String name, final List<Partition> new_parts, - EnvironmentContext environmentContext, IHMSHandler handler) + EnvironmentContext environmentContext, + long txnId, String writeIdList, IHMSHandler handler) throws InvalidOperationException, InvalidObjectException, AlreadyExistsException, MetaException { List<Partition> oldParts = new ArrayList<>(); List<List<String>> partValsList = new ArrayList<>(); @@ -678,7 +680,7 @@ public class HiveAlterHandler implements AlterHandler { try { msdb.openTransaction(); - Table tbl = msdb.getTable(catName, dbname, name); + Table tbl = msdb.getTable(catName, dbname, name, -1, null); if (tbl == null) { throw new InvalidObjectException( "Unable to alter partitions because table or database does not exist."); @@ -713,7 +715,7 @@ public class HiveAlterHandler implements AlterHandler { } } - msdb.alterPartitions(catName, dbname, name, partValsList, new_parts); + msdb.alterPartitions(catName, dbname, name, partValsList, new_parts, txnId, writeIdList); Iterator<Partition> oldPartsIt = oldParts.iterator(); for (Partition newPart : new_parts) { Partition oldPart; http://git-wip-us.apache.org/repos/asf/hive/blob/1d46608e/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index e88f9a5..248c4b3 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -2437,7 +2437,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { private boolean is_table_exists(RawStore ms, String catName, String dbname, String name) throws MetaException { - return (ms.getTable(catName, dbname, name) != null); + return (ms.getTable(catName, dbname, name, -1, null) != null); } private boolean drop_table_core(final RawStore ms, final String catName, final String dbname, @@ -2599,7 +2599,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { tableDnsPath = wh.getDnsPath(tablePath); } List<Path> partPaths = new ArrayList<>(); - Table tbl = ms.getTable(catName, dbName, tableName); + Table tbl = ms.getTable(catName, dbName, tableName, -1, null); // call dropPartition on each of the table's partitions to follow the // procedure for cleanly dropping partitions. @@ -2842,7 +2842,8 @@ public class HiveMetaStore extends ThriftHiveMetastore { public Table get_table(final String dbname, final String name) throws MetaException, NoSuchObjectException { String[] parsedDbName = parseDbName(dbname, conf); - return getTableInternal(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], name, null); + return getTableInternal( + parsedDbName[CAT_NAME], parsedDbName[DB_NAME], name, null, -1, null); } @Override @@ -2850,11 +2851,12 @@ public class HiveMetaStore extends ThriftHiveMetastore { NoSuchObjectException { String catName = req.isSetCatName() ? req.getCatName() : getDefaultCatalog(conf); return new GetTableResult(getTableInternal(catName, req.getDbName(), req.getTblName(), - req.getCapabilities())); + req.getCapabilities(), req.getTxnId(), req.getValidWriteIdList())); } private Table getTableInternal(String catName, String dbname, String name, - ClientCapabilities capabilities) throws MetaException, NoSuchObjectException { + ClientCapabilities capabilities, long txnId, String writeIdList) + throws MetaException, NoSuchObjectException { if (isInTest) { assertClientHasCapability(capabilities, ClientCapability.TEST_CAPABILITY, "Hive tests", "get_table_req"); @@ -2864,7 +2866,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { startTableFunction("get_table", catName, dbname, name); Exception ex = null; try { - t = get_table_core(catName, dbname, name); + t = get_table_core(catName, dbname, name, txnId, writeIdList); if (MetaStoreUtils.isInsertOnlyTableParam(t.getParameters())) { assertClientHasCapability(capabilities, ClientCapability.INSERT_ONLY_TABLES, "insert-only tables", "get_table_req"); @@ -2899,11 +2901,25 @@ public class HiveMetaStore extends ThriftHiveMetastore { } @Override - public Table get_table_core(final String catName, final String dbname, final String name) + public Table get_table_core( + final String catName, + final String dbname, + final String name) + throws MetaException, NoSuchObjectException { + return get_table_core(catName, dbname, name, -1, null); + } + + @Override + public Table get_table_core( + final String catName, + final String dbname, + final String name, + final long txnId, + final String writeIdList) throws MetaException, NoSuchObjectException { Table t = null; try { - t = getMS().getTable(catName, dbname, name); + t = getMS().getTable(catName, dbname, name, txnId, writeIdList); if (t == null) { throw new NoSuchObjectException(TableName.getQualified(catName, dbname, name) + " table not found"); @@ -3085,7 +3101,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { MetaStoreUtils.validatePartitionNameCharacters(part_vals, partitionValidationPattern); - tbl = ms.getTable(part.getCatName(), part.getDbName(), part.getTableName()); + tbl = ms.getTable(part.getCatName(), part.getDbName(), part.getTableName(), -1, null); if (tbl == null) { throw new InvalidObjectException( "Unable to add partition because table or database do not exist"); @@ -3279,7 +3295,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { try { ms.openTransaction(); - tbl = ms.getTable(catName, dbName, tblName); + tbl = ms.getTable(catName, dbName, tblName, -1, null); if (tbl == null) { throw new InvalidObjectException("Unable to add partitions because " + TableName.getQualified(catName, dbName, tblName) + @@ -3550,7 +3566,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { Database db = null; try { ms.openTransaction(); - tbl = ms.getTable(catName, dbName, tblName); + tbl = ms.getTable(catName, dbName, tblName, -1, null); if (tbl == null) { throw new InvalidObjectException("Unable to add partitions because " + "database or table " + dbName + "." + tblName + " does not exist"); @@ -3804,7 +3820,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { } try { ms.openTransaction(); - tbl = ms.getTable(part.getCatName(), part.getDbName(), part.getTableName()); + tbl = ms.getTable(part.getCatName(), part.getDbName(), part.getTableName(), -1, null); if (tbl == null) { throw new InvalidObjectException( "Unable to add partition because table or database do not exist"); @@ -3925,14 +3941,16 @@ public class HiveMetaStore extends ThriftHiveMetastore { ms.openTransaction(); Table destinationTable = - ms.getTable(parsedDestDbName[CAT_NAME], parsedDestDbName[DB_NAME], destTableName); + ms.getTable( + parsedDestDbName[CAT_NAME], parsedDestDbName[DB_NAME], destTableName, -1, null); if (destinationTable == null) { throw new MetaException( "The destination table " + TableName.getQualified(parsedDestDbName[CAT_NAME], parsedDestDbName[DB_NAME], destTableName) + " not found"); } Table sourceTable = - ms.getTable(parsedSourceDbName[CAT_NAME], parsedSourceDbName[DB_NAME], sourceTableName); + ms.getTable( + parsedSourceDbName[CAT_NAME], parsedSourceDbName[DB_NAME], sourceTableName, -1, null); if (sourceTable == null) { throw new MetaException("The source table " + TableName.getQualified(parsedSourceDbName[CAT_NAME], @@ -4109,7 +4127,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { try { ms.openTransaction(); part = ms.getPartition(catName, db_name, tbl_name, part_vals); - tbl = get_table_core(catName, db_name, tbl_name); + tbl = get_table_core(catName, db_name, tbl_name, -1, null); isExternalTbl = isExternal(tbl); firePreEvent(new PreDropPartitionEvent(tbl, part, deleteData, this)); mustPurge = isMustPurge(envContext, tbl); @@ -4837,7 +4855,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { Table table = null; if (!listeners.isEmpty()) { if (table == null) { - table = getMS().getTable(catName, db_name, tbl_name); + table = getMS().getTable(catName, db_name, tbl_name, -1, null); } MetaStoreListenerNotifier.notifyEvent(listeners, @@ -4866,12 +4884,23 @@ public class HiveMetaStore extends ThriftHiveMetastore { public void alter_partitions(final String db_name, final String tbl_name, final List<Partition> new_parts) throws TException { - alter_partitions_with_environment_context(db_name, tbl_name, new_parts, null); + alter_partitions_with_environment_context( + db_name, tbl_name, new_parts, null, -1, null); } @Override - public void alter_partitions_with_environment_context(final String db_name, final String tbl_name, - final List<Partition> new_parts, EnvironmentContext environmentContext) + public AlterPartitionsResponse alter_partitions_with_environment_context( + AlterPartitionsRequest req) + throws TException { + alter_partitions_with_environment_context( + req.getDbName(), req.getTableName(), req.getPartitions(), req.getEnvironmentContext(), + req.getTxnId(), req.getValidWriteIdList()); + return new AlterPartitionsResponse(); + } + + private void alter_partitions_with_environment_context(final String db_name, final String tbl_name, + final List<Partition> new_parts, EnvironmentContext environmentContext, + long txnId, String writeIdList) throws TException { String[] parsedDbName = parseDbName(db_name, conf); @@ -4895,7 +4924,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { firePreEvent(new PreAlterPartitionEvent(parsedDbName[DB_NAME], tbl_name, null, tmpPart, this)); } oldParts = alterHandler.alterPartitions(getMS(), wh, parsedDbName[CAT_NAME], - parsedDbName[DB_NAME], tbl_name, new_parts, environmentContext, this); + parsedDbName[DB_NAME], tbl_name, new_parts, environmentContext, txnId, writeIdList, this); Iterator<Partition> olditr = oldParts.iterator(); // Only fetch the table if we have a listener that needs it. Table table = null; @@ -4909,7 +4938,8 @@ public class HiveMetaStore extends ThriftHiveMetastore { } if (table == null) { - table = getMS().getTable(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name); + table = getMS().getTable( + parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tbl_name, -1, null); } if (!listeners.isEmpty()) { @@ -5329,7 +5359,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { private List<String> getPartValsFromName(RawStore ms, String catName, String dbName, String tblName, String partName) throws MetaException, InvalidObjectException { - Table t = ms.getTable(catName, dbName, tblName); + Table t = ms.getTable(catName, dbName, tblName, -1, null); if (t == null) { throw new InvalidObjectException(dbName + "." + tblName + " table not found"); @@ -5584,7 +5614,8 @@ public class HiveMetaStore extends ThriftHiveMetastore { ColumnStatistics statsObj = null; try { statsObj = getMS().getTableColumnStatistics( - parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tableName, Lists.newArrayList(colName)); + parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tableName, Lists.newArrayList(colName), + -1, null); if (statsObj != null) { assert statsObj.getStatsObjSize() <= 1; } @@ -5608,7 +5639,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { lowerCaseColNames.add(colName.toLowerCase()); } try { - ColumnStatistics cs = getMS().getTableColumnStatistics(catName, dbName, tblName, lowerCaseColNames); + ColumnStatistics cs = getMS().getTableColumnStatistics( + catName, dbName, tblName, lowerCaseColNames, + request.getTxnId(), request.getValidWriteIdList()); result = new TableStatsResult((cs == null || cs.getStatsObj() == null) ? Lists.newArrayList() : cs.getStatsObj()); } finally { @@ -7315,8 +7348,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { AggrStats aggrStats = null; try { - aggrStats = new AggrStats(getMS().get_aggr_stats_for(catName, dbName, tblName, - lowerCasePartNames, lowerCaseColNames)); + aggrStats = getMS().get_aggr_stats_for(catName, dbName, tblName, + lowerCasePartNames, lowerCaseColNames, request.getTxnId(), + request.getValidWriteIdList()); return aggrStats; } finally { endFunction("get_aggr_stats_for", aggrStats == null, null, request.getTblName()); @@ -7350,7 +7384,10 @@ public class HiveMetaStore extends ThriftHiveMetastore { } else { if (request.isSetNeedMerge() && request.isNeedMerge()) { // one single call to get all column stats - ColumnStatistics csOld = getMS().getTableColumnStatistics(catName, dbName, tableName, colNames); + ColumnStatistics csOld = + getMS().getTableColumnStatistics( + catName, dbName, tableName, colNames, + request.getTxnId(), request.getValidWriteIdList()); Table t = getTable(catName, dbName, tableName); // we first use t.getParameters() to prune the stats MetaStoreUtils.getMergableCols(firstColStats, t.getParameters()); @@ -7390,8 +7427,10 @@ public class HiveMetaStore extends ThriftHiveMetastore { // a single call to get all column stats for all partitions List<String> partitionNames = new ArrayList<>(); partitionNames.addAll(newStatsMap.keySet()); - List<ColumnStatistics> csOlds = getMS().getPartitionColumnStatistics(catName, dbName, - tableName, partitionNames, colNames); + List<ColumnStatistics> csOlds = + getMS().getPartitionColumnStatistics( + catName, dbName, tableName, partitionNames, colNames, + request.getTxnId(), request.getValidWriteIdList()); if (newStatsMap.values().size() != csOlds.size()) { // some of the partitions miss stats. LOG.debug("Some of the partitions miss stats."); @@ -7405,7 +7444,8 @@ public class HiveMetaStore extends ThriftHiveMetastore { mapToPart.put(partitionNames.get(index), partitions.get(index)); } } - Table t = getTable(catName, dbName, tableName); + Table t = getTable(catName, dbName, tableName, + request.getTxnId(), request.getValidWriteIdList()); for (Entry<String, ColumnStatistics> entry : newStatsMap.entrySet()) { ColumnStatistics csNew = entry.getValue(); ColumnStatistics csOld = oldStatsMap.get(entry.getKey()); @@ -7432,7 +7472,13 @@ public class HiveMetaStore extends ThriftHiveMetastore { private Table getTable(String catName, String dbName, String tableName) throws MetaException, InvalidObjectException { - Table t = getMS().getTable(catName, dbName, tableName); + return getTable(catName, dbName, tableName, -1, null); + } + + private Table getTable(String catName, String dbName, String tableName, + long txnId, String writeIdList) + throws MetaException, InvalidObjectException { + Table t = getMS().getTable(catName, dbName, tableName, txnId, writeIdList); if (t == null) { throw new InvalidObjectException(TableName.getQualified(catName, dbName, tableName) + " table not found");