Skip to content

Commit

Permalink
Start Presto on 8080 in SqlServerQueryRunner.main
Browse files Browse the repository at this point in the history
This makes it easier to connect to Presto thus started and makes the
runner's main consistent with other runners.
  • Loading branch information
findepi committed Sep 30, 2020
1 parent 98264f8 commit 93e2ed1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ private SqlServerQueryRunner() {}

private static final String TEST_SCHEMA = "dbo";

public static QueryRunner createSqlServerQueryRunner(TestingSqlServer testingSqlServer, Map<String, String> connectorProperties, Iterable<TpchTable<?>> tables)
public static QueryRunner createSqlServerQueryRunner(
TestingSqlServer testingSqlServer,
Map<String, String> extraProperties,
Map<String, String> connectorProperties,
Iterable<TpchTable<?>> tables)
throws Exception
{
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createSession(testingSqlServer.getUsername()))
DistributedQueryRunner queryRunner = DistributedQueryRunner
.builder(createSession(testingSqlServer.getUsername()))
.setExtraProperties(extraProperties)
.build();
try {
queryRunner.installPlugin(new TpchPlugin());
Expand Down Expand Up @@ -106,6 +112,7 @@ public static void main(String[] args)

DistributedQueryRunner queryRunner = (DistributedQueryRunner) createSqlServerQueryRunner(
testingSqlServer,
ImmutableMap.of("http-server.http.port", "8080"),
ImmutableMap.of(),
ImmutableList.of());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected QueryRunner createQueryRunner()
sqlServer.start();
return createSqlServerQueryRunner(
sqlServer,
ImmutableMap.of(),
ImmutableMap.<String, String>builder()
// caching here speeds up tests highly, caching is not used in smoke tests
.put("metadata.cache-ttl", "10m")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected QueryRunner createQueryRunner()
{
sqlServer = new TestingSqlServer();
sqlServer.start();
return createSqlServerQueryRunner(sqlServer, ImmutableMap.of(), ImmutableList.of(CUSTOMER, NATION, ORDERS, REGION));
return createSqlServerQueryRunner(sqlServer, ImmutableMap.of(), ImmutableMap.of(), ImmutableList.of(CUSTOMER, NATION, ORDERS, REGION));
}

@AfterClass(alwaysRun = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ protected QueryRunner createQueryRunner()
return createSqlServerQueryRunner(
sqlServer,
ImmutableMap.of(),
ImmutableMap.of(),
ImmutableList.of());
}

Expand Down

0 comments on commit 93e2ed1

Please sign in to comment.