[ https://issues.apache.org/jira/browse/HIVE-20929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16691157#comment-16691157 ]
weizheng commented on HIVE-20929: --------------------------------- If the parameter validTxnList is not passed,the default value is null. The following is the implementation of *{color:#FF0000}HiveMetaStoreClient.getValidWriteIds(String fullTableName).{color}* public ValidWriteIdList getValidWriteIds(String fullTableName) throws TException { GetValidWriteIdsRequest rqst = new GetValidWriteIdsRequest(Collections.singletonList(fullTableName), *{color:#FF0000}null{color}*); GetValidWriteIdsResponse validWriteIds = client.get_valid_write_ids(rqst); return TxnUtils.createValidReaderWriteIdList(validWriteIds.getTblValidWriteIds().get(0)); } so I got errors that {color:#FF0000}Required field 'validTxnList' is unset!{color} > The method HiveMetaStoreClient.getValidWriteIds(String fullTableName) failed > to execute. > ---------------------------------------------------------------------------------------- > > Key: HIVE-20929 > URL: https://issues.apache.org/jira/browse/HIVE-20929 > Project: Hive > Issue Type: Bug > Components: Standalone Metastore > Affects Versions: 3.1.0 > Environment: hadoop3.1.0 > hive3.1.0 > Reporter: weizheng > Assignee: weizheng > Priority: Major > > When I use the getValidWriteIds(String fullTableName) method of > HiveMetaStoreClient to get writeIds, I get the errors: > Exception in thread "main" org.apache.thrift.protocol.TProtocolException: > Required field 'validTxnList' is unset! > Struct:GetValidWriteIdsRequest(fullTableNames:[default.w2], validTxnList:null) > at > org.apache.hadoop.hive.metastore.api.GetValidWriteIdsRequest.validate(GetValidWriteIdsRequest.java:396) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_valid_write_ids_args.validate(ThriftHiveMetastore.java) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_valid_write_ids_args$get_valid_write_ids_argsStandardScheme.write(ThriftHiveMetastore.java) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_valid_write_ids_args$get_valid_write_ids_argsStandardScheme.write(ThriftHiveMetastore.java) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$get_valid_write_ids_args.write(ThriftHiveMetastore.java) > at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:71) > at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_get_valid_write_ids(ThriftHiveMetastore.java:5443) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_valid_write_ids(ThriftHiveMetastore.java:5435) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getValidWriteIds(HiveMetaStoreClient.java:2581) > at com.inspur.mutation.test.TableOperate.getRowsMap(TableOperate.java:521) > at com.inspur.procuder.GenerateData.main(GenerateData.java:65) > > So I can only use the following methods instead: > ValidWriteIdList writeIds; > tablesList.add(AcidUtils.getFullTableName(table.getDbName(), > table.getTableName())); > List<TableValidWriteIds> writeIdList = > metaStoreClient.getValidWriteIds(tablesList,txns.toString()); > writeIds = TxnUtils.createValidReaderWriteIdList(writeIdList.get(0)); -- This message was sent by Atlassian JIRA (v7.6.3#76005)