Source:
public void testAction() throws Exception { try (Connection connection = getConnection()) { try (Statement statement = connection.createStatement()) { statement.execute("create table \"actionTest\" (x int, day varchar(10))"); } try (Statement statement = connection.createStatement()) { statement.execute("insert into \"actionTest\" values (1, '1970-01-01')"); } } ETLStage source = new ETLStage("source", MockSource.getPlugin("actionInput")); ETLStage sink = new ETLStage("sink", MockSink.getPlugin("actionOutput")); ETLStage action = new ETLStage("action", new ETLPlugin( "DatabaseQuery", PostAction.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put("connectionString", getConnectionURL()) .put("jdbcPluginName", "hypersql") .put("jdbcPluginType", "jdbc") .put("command", "delete from \"actionTest\" where day = '1970-01-01'") .put("enableAutoCommit", "false") .put("runCondition", "success") .build(), null)); ETLBatchConfig config = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addPostAction(action) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(ETLBATCH_ARTIFACT, config); Id.Application appId = Id.Application.from(Id.Namespace.DEFAULT, "actionTest"); ApplicationManager appManager = deployApplication(appId, appRequest); WorkflowManager workflowManager = appManager.getWorkflowManager(ETLWorkflow.NAME); workflowManager.start(ImmutableMap.of("logical.start.time", "0")); workflowManager.waitForFinish(5, TimeUnit.MINUTES); try (Connection connection = getConnection()) { try (Statement statement = connection.createStatement()) { try (ResultSet results = statement.executeQuery("select * from \"actionTest\"")) { Assert.assertFalse(results.next()); } } } }

Target:
public void testAction() throws Exception { try (Connection connection = getConnection()) { try (Statement statement = connection.createStatement()) { statement.execute("create table \"postActionTest\" (x int, day varchar(10))"); } try (Statement statement = connection.createStatement()) { statement.execute("insert into \"postActionTest\" values (1, '1970-01-01')"); } } ETLStage source = new ETLStage("source", MockSource.getPlugin("actionInput")); ETLStage sink = new ETLStage("sink", MockSink.getPlugin("actionOutput")); ETLStage action = new ETLStage("action", new ETLPlugin( "DatabaseQuery", PostAction.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put("connectionString", getConnectionURL()) .put("jdbcPluginName", "hypersql") .put("jdbcPluginType", "jdbc") .put("query", "delete from \"postActionTest\" where day = '${logicalStartTime(yyyy-MM-dd,0m,UTC)}'") .put("enableAutoCommit", "false") .put("runCondition", "success") .build(), null)); ETLBatchConfig config = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addPostAction(action) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(ETLBATCH_ARTIFACT, config); Id.Application appId = Id.Application.from(Id.Namespace.DEFAULT, "postActionTest"); ApplicationManager appManager = deployApplication(appId, appRequest); WorkflowManager workflowManager = appManager.getWorkflowManager(ETLWorkflow.NAME); workflowManager.start(ImmutableMap.of("logical.start.time", "0")); workflowManager.waitForFinish(5, TimeUnit.MINUTES); try (Connection connection = getConnection()) { try (Statement statement = connection.createStatement()) { try (ResultSet results = statement.executeQuery("select * from \"postActionTest\"")) { Assert.assertFalse(results.next()); } } } }