saihemanth-cloudera commented on code in PR #5582:
URL: https://github.com/apache/hive/pull/5582#discussion_r1925703893
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/TruncatePartitionHandler.java:
##########
@@ -35,17 +39,39 @@
public class TruncatePartitionHandler extends AbstractMessageHandler {
@Override
public List<Task<?>> handle(Context context) throws SemanticException {
- AlterPartitionMessage msg =
deserializer.getAlterPartitionMessage(context.dmd.getPayload());
- final TableName tName = TableName.fromString(msg.getTable(), null,
- context.isDbNameEmpty() ? msg.getDB() : context.dbName);
-
- Map<String, String> partSpec = new LinkedHashMap<>();
+ final TableName tName;
org.apache.hadoop.hive.metastore.api.Table tblObj;
try {
- tblObj = msg.getTableObj();
- Iterator<String> afterIterator =
msg.getPtnObjAfter().getValuesIterator();
- for (FieldSchema fs : tblObj.getPartitionKeys()) {
- partSpec.put(fs.getName(), afterIterator.next());
+ if (MetastoreConf.getBoolVar(context.hiveConf,
+ MetastoreConf.ConfVars.NOTIFICATION_ALTER_PARTITIONS_V2_ENABLED)) {
+ AlterPartitionsMessage singleMsg =
deserializer.getAlterPartitionsMessage(
+ context.dmd.getPayload());
+ tName = TableName.fromString(singleMsg.getTable(), null,
+ context.isDbNameEmpty() ? singleMsg.getDB() : context.dbName);
+ tblObj = singleMsg.getTableObj();
Review Comment:
Replication tests fail because during the replication it would require
source DB name(which we get it from 'context' variable).
--
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]