Source:
<code>public void testNoPartitionRetentionForReplTarget() throws TException, InterruptedException { String dbName = "db_repl2"; String tableName = "tbl_repl2"; Map<String, Column> colMap = buildAllColumns(); List<String> partKeys = Lists.newArrayList("state", "dt"); List<String> partKeyTypes = Lists.newArrayList("string", "date"); List<List<String>> partVals = Lists.newArrayList( Lists.newArrayList("__HIVE_DEFAULT_PARTITION__", "1990-01-01"), Lists.newArrayList("CA", "1986-04-28"), Lists.newArrayList("MN", "2018-11-31")); long partitionRetentionPeriodMs = 20000; long waitingPeriodForTest = partitionRetentionPeriodMs + 10 * 1000; createMetadata(DEFAULT_CATALOG_NAME, dbName, tableName, partKeys, partKeyTypes, partVals, colMap, false); Table table = client.getTable(dbName, tableName); List<Partition> partitions = client.listPartitions(dbName, tableName, (short) -1); assertEquals(3, partitions.size()); table.getParameters().put(PartitionManagementTask.DISCOVER_PARTITIONS_TBLPROPERTY, "true"); table.getParameters().put(PartitionManagementTask.PARTITION_RETENTION_PERIOD_TBLPROPERTY, partitionRetentionPeriodMs + "ms"); table.getParameters().put(ReplConst.REPL_TARGET_PROPERTY, "1"); client.alter_table(dbName, tableName, table); runPartitionManagementTask(conf); partitions = client.listPartitions(dbName, tableName, (short) -1); assertEquals(3, partitions.size()); Thread.sleep(waitingPeriodForTest); runPartitionManagementTask(conf); partitions = client.listPartitions(dbName, tableName, (short) -1); assertEquals(3, partitions.size()); <START> } <END></code><technical_language>partition cleanup is done ..add a table REPL_TARGET_PROPERTY set check partitions there</technical_language>

Target:
public void testNoPartitionRetentionForReplTarget() throws TException, InterruptedException { String dbName = "db_repl2"; String tableName = "tbl_repl2"; Map<String, Column> colMap = buildAllColumns(); List<String> partKeys = Lists.newArrayList("state", "dt"); List<String> partKeyTypes = Lists.newArrayList("string", "date"); List<List<String>> partVals = Lists.newArrayList( Lists.newArrayList("__HIVE_DEFAULT_PARTITION__", "1990-01-01"), Lists.newArrayList("CA", "1986-04-28"), Lists.newArrayList("MN", "2018-11-31")); long partitionRetentionPeriodMs = 20000; long waitingPeriodForTest = partitionRetentionPeriodMs + 10 * 1000; createMetadata(DEFAULT_CATALOG_NAME, dbName, tableName, partKeys, partKeyTypes, partVals, colMap, false); Table table = client.getTable(dbName, tableName); List<Partition> partitions = client.listPartitions(dbName, tableName, (short) -1); assertEquals(3, partitions.size()); table.getParameters().put(PartitionManagementTask.DISCOVER_PARTITIONS_TBLPROPERTY, "true"); table.getParameters().put(PartitionManagementTask.PARTITION_RETENTION_PERIOD_TBLPROPERTY, partitionRetentionPeriodMs + "ms"); table.getParameters().put(ReplConst.REPL_TARGET_TABLE_PROPERTY, "1"); client.alter_table(dbName, tableName, table); runPartitionManagementTask(conf); partitions = client.listPartitions(dbName, tableName, (short) -1); assertEquals(3, partitions.size()); Thread.sleep(waitingPeriodForTest); runPartitionManagementTask(conf); partitions = client.listPartitions(dbName, tableName, (short) -1); assertEquals(3, partitions.size()); }