Source:
public void testDBAction() throws Exception { try (Connection connection = getConnection()) { try (Statement statement = connection.createStatement()) { statement.execute("create table \"dbActionTest\" (x int, day varchar(10))"); } try (Statement statement = connection.createStatement()) { statement.execute("insert into \"dbActionTest\" 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( "DBAction", Action.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put("connectionString", getConnectionURL()) .put("jdbcPluginName", "hypersql") .put("query", "delete from \"dbActionTest\" where day = '${logicalStartTime(yyyy-MM-dd,0m,UTC)}'") .build(), null)); ETLBatchConfig config = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addStage(action) .addConnection(sink.getName(), action.getName()) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(DATAPIPELINE_ARTIFACT, config); Id.Application appId = Id.Application.from(Id.Namespace.DEFAULT, "actionTest"); ApplicationManager appManager = deployApplication(appId, appRequest); WorkflowManager workflowManager = appManager.getWorkflowManager(SmartWorkflow.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 \"dbActionTest\"")) { Assert.assertFalse(results.next()); } } } }

Target:
public void testDBAction() throws Exception { try (Connection connection = getConnection()) { try (Statement statement = connection.createStatement()) { statement.execute("create table \"dbActionTest\" (x int, day varchar(10))"); } try (Statement statement = connection.createStatement()) { statement.execute("insert into \"dbActionTest\" 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( "DatabaseAction", Action.PLUGIN_TYPE, ImmutableMap.<String, String>builder() .put("connectionString", getConnectionURL()) .put("jdbcPluginName", "hypersql") .put("query", "delete from \"dbActionTest\" where day = '${logicalStartTime(yyyy-MM-dd,0m,UTC)}'") .build(), null)); ETLBatchConfig config = ETLBatchConfig.builder("* * * * *") .addStage(source) .addStage(sink) .addStage(action) .addConnection(sink.getName(), action.getName()) .addConnection(source.getName(), sink.getName()) .build(); AppRequest<ETLBatchConfig> appRequest = new AppRequest<>(DATAPIPELINE_ARTIFACT, config); Id.Application appId = Id.Application.from(Id.Namespace.DEFAULT, "actionTest"); ApplicationManager appManager = deployApplication(appId, appRequest); WorkflowManager workflowManager = appManager.getWorkflowManager(SmartWorkflow.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 \"dbActionTest\"")) { Assert.assertFalse(results.next()); } } } }