Source:
<code>public static void SET_MIN_RETENTION_PERIOD(String schemaName, String tableName, long retentionPeriod) throws StandardException, SQLException { schemaName = EngineUtils.validateSchema(schemaName); tableName = tableName == null ? null : EngineUtils.validateTable(tableName); if(retentionPeriod < 0) { throw StandardException.newException(SQLState.LANG_INVALID_VALUE_RANGE, retentionPeriod, "non-negative number"); } LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); TransactionController tc = lcc.getTransactionExecute(); DataDictionary dd = lcc.getDataDictionary(); SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true); if (sd == null) { throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, schemaName); } List<TableDescriptor> affectedTables = new ArrayList<>(); if (tableName != null) { TableDescriptor td = dd.getTableDescriptor(tableName, sd, tc); if (td == null) { throw StandardException.newException(SQLState.TABLE_NOT_FOUND, tableName); } affectedTables.add(td); } else { <START> affectedTables.addAll(getTablesInSchema(dd, getDefaultConn(), sd.getUUID().toString())); <END> } dd.startWriting(lcc); for(TableDescriptor td : affectedTables) { DDLMessage.DDLChange ddlChange = ProtoUtil.createAlterTable(((SpliceTransactionManager) tc).getActiveStateTxn().getTxnId(), (BasicUUID) td.getUUID()); DependencyManager dm = dd.getDependencyManager(); dm.invalidateFor(td, DependencyManager.ALTER_TABLE, lcc); tc.prepareDataDictionaryChange(DDLUtils.notifyMetadataChange(ddlChange)); td.setMinRetainedPeriod(retentionPeriod); dd.dropTableDescriptor(td, sd, tc); dd.addDescriptor(td, sd, DataDictionary.SYSTABLES_CATALOG_NUM, false, tc, false); } }</code><technical_language>Do mark main tables only? do mark indices well</technical_language>

Target:
public static void SET_MIN_RETENTION_PERIOD(String schemaName, String tableName, long retentionPeriod) throws StandardException, SQLException { schemaName = EngineUtils.validateSchema(schemaName); tableName = tableName == null ? null : EngineUtils.validateTable(tableName); if(retentionPeriod < 0) { throw StandardException.newException(SQLState.LANG_INVALID_VALUE_RANGE, retentionPeriod, "non-negative number"); } LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC(); TransactionController tc = lcc.getTransactionExecute(); DataDictionary dd = lcc.getDataDictionary(); SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true); if (sd == null) { throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, schemaName); } List<TableDescriptor> affectedTables = new ArrayList<>(); if (tableName != null) { TableDescriptor td = dd.getTableDescriptor(tableName, sd, tc); if (td == null) { throw StandardException.newException(SQLState.TABLE_NOT_FOUND, tableName); } affectedTables.add(td); } else { affectedTables.addAll(getTablesInSchema(dd, getDefaultConn(), sd.getUUID().toString())); } dd.startWriting(lcc); for(TableDescriptor td : affectedTables) { DDLMessage.DDLChange ddlChange = ProtoUtil.createAlterTable(((SpliceTransactionManager) tc).getActiveStateTxn().getTxnId(), (BasicUUID) td.getUUID()); DependencyManager dm = dd.getDependencyManager(); dm.invalidateFor(td, DependencyManager.ALTER_TABLE, lcc); tc.prepareDataDictionaryChange(DDLUtils.notifyMetadataChange(ddlChange)); if(td.purgeDeletedRows()) { SpliceLogUtils.warn(LOG, "setting minimum retention period on table %s which has purge deleted " + "rows set to true, this could lead to incorrect time travel query results", td.getName()); } td.setMinRetainedPeriod(retentionPeriod); dd.dropTableDescriptor(td, sd, tc); dd.addDescriptor(td, sd, DataDictionary.SYSTABLES_CATALOG_NUM, false, tc, false); } }