Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void testWithHsqldb() throws SQLException {
final ExecutionStage sqlStage = mock(ExecutionStage.class);

final JdbcTableSource tableSourceA = new HsqldbTableSource("testA");

final ExecutionTask tableSourceATask = new ExecutionTask(tableSourceA);
tableSourceATask.setOutputChannel(0, new SqlQueryChannel(sqlChannelDescriptor, tableSourceA.getOutput(0)));
tableSourceATask.setStage(sqlStage);
Expand All @@ -86,14 +86,23 @@ void testWithHsqldb() throws SQLException {
globalReduceTask.getOutputChannel(0).addConsumer(sqlToStreamTask, 0);
sqlToStreamTask.setStage(nextStage);


final HsqldbPlatform hsqldbPlatform = new HsqldbPlatform();

try (Connection jdbcConnection = hsqldbPlatform.createDatabaseDescriptor(configuration).createJdbcConnection()) {
final Statement statement = jdbcConnection.createStatement();
statement.execute("CREATE TABLE IF NOT EXISTS testA (a INT, b VARCHAR(6));");
statement.execute("INSERT INTO testA VALUES (0, 'zero');");
statement.execute("CREATE TABLE IF NOT EXISTS testB (a INT, b INT);");
statement.execute("INSERT INTO testB VALUES (0, 100);");
}

final JdbcExecutor executor = new JdbcExecutor(HsqldbPlatform.getInstance(), job);
executor.execute(sqlStage, new DefaultOptimizationContext(job), job.getCrossPlatformExecutor());

final SqlQueryChannel.Instance sqlQueryChannelInstance = (SqlQueryChannel.Instance) job.getCrossPlatformExecutor()
.getChannelInstance(sqlToStreamTask.getInputChannel(0));

final HsqldbPlatform hsqldbPlatform = new HsqldbPlatform();

try (Connection jdbcConnection = hsqldbPlatform.createDatabaseDescriptor(configuration).createJdbcConnection()) {
final Statement statement = jdbcConnection.createStatement();
final java.sql.ResultSet resultSet = statement.executeQuery(sqlQueryChannelInstance.getSqlQuery());
Expand Down
Loading