dengzhhu653 commented on code in PR #3599:
URL: https://github.com/apache/hive/pull/3599#discussion_r1672299415
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -3977,38 +4088,78 @@ private void firePreEvent(PreEventContext event) throws
MetaException {
}
@Override
+ @Deprecated
public Partition append_partition(final String dbName, final String
tableName,
- final List<String> part_vals) throws
InvalidObjectException,
+ final List<String> part_vals) throws InvalidObjectException,
AlreadyExistsException, MetaException {
- return append_partition_with_environment_context(dbName, tableName,
part_vals, null);
+ String[] parsedDbName = parseDbName(dbName, conf);
+ AppendPartitionsRequest appendPartitionsReq = new
AppendPartitionsRequest();
+ appendPartitionsReq.setDbName(parsedDbName[DB_NAME]);
+ appendPartitionsReq.setTableName(tableName);
+ appendPartitionsReq.setPartVals(part_vals);
+ appendPartitionsReq.setCatalogName(parsedDbName[CAT_NAME]);
+ return append_partition_req(appendPartitionsReq);
}
@Override
+ @Deprecated
public Partition append_partition_with_environment_context(final String
dbName,
- final String
tableName, final List<String> part_vals, final EnvironmentContext envContext)
+ final String tableName, final List<String> part_vals, final
EnvironmentContext envContext)
throws InvalidObjectException, AlreadyExistsException, MetaException {
- if (part_vals == null || part_vals.isEmpty()) {
+ String[] parsedDbName = parseDbName(dbName, conf);
+ startPartitionFunction("append_partition_with_environment_context",
parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tableName, part_vals);
+ Partition ret = null;
+ Exception ex = null;
+ try {
+ AppendPartitionsRequest appendPartitionsReq = new
AppendPartitionsRequest();
+ appendPartitionsReq.setDbName(parsedDbName[DB_NAME]);
+ appendPartitionsReq.setTableName(tableName);
+ appendPartitionsReq.setPartVals(part_vals);
+ appendPartitionsReq.setCatalogName(parsedDbName[CAT_NAME]);
+ appendPartitionsReq.setEnvironmentContext(envContext);
+ ret = append_partition_req(appendPartitionsReq);
+ } catch (Exception e) {
+ ex = e;
+ throw handleException(e).throwIfInstance(MetaException.class,
InvalidObjectException.class, AlreadyExistsException.class)
+ .defaultMetaException();
+ } finally {
+ endFunction("append_partition_with_environment_context", ret != null,
ex, tableName);
+ }
+ return ret;
+ }
+
+ @Override
+ public Partition append_partition_req(final AppendPartitionsRequest
appendPartitionsReq)
+ throws InvalidObjectException, AlreadyExistsException, MetaException {
+ List<String> part_vals = appendPartitionsReq.getPartVals();
+ String dbName = appendPartitionsReq.getDbName();
+ String catName = appendPartitionsReq.getCatalogName();
Review Comment:
nit: catName could be null, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]