...
For every read request involving table/partitions, HMS client need to pass a validWriteIdList string in addition to the existing arguments. validWriteIdList can be null if it is external table, as HMS will return whatever in the cache for external table using eventual consistency. But if validWriteIdList=null for managed table, HMS will throw exception. validWriteIdList is a serialized form of ValidReaderWriteIdList. Usually ValidReaderWriteIdList can be obtained from HiveTxnManager using the following code snippet:
Code Block | ||
---|---|---|
| ||
ValidTxnList txnIds = txnMgr.getValidTxns(); // get global transaction state txnWriteIds = txnMgr.getValidWriteIds(txnTables, txnString); // map global transaction state to table specific write id |
...