use of com.facebook.presto.tests.DistributedQueryRunner in project presto by prestodb.
the class BlackHoleQueryRunner method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties) throws Exception {
Session session = testSessionBuilder().setCatalog("blackhole").setSchema("default").build();
DistributedQueryRunner queryRunner = new DistributedQueryRunner(session, 4, extraProperties);
try {
queryRunner.installPlugin(new BlackHolePlugin());
queryRunner.createCatalog("blackhole", "blackhole", ImmutableMap.of());
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of());
return queryRunner;
} catch (Exception e) {
closeAllSuppress(e, queryRunner);
throw e;
}
}
use of com.facebook.presto.tests.DistributedQueryRunner in project presto by prestodb.
the class BlackHoleQueryRunner method main.
public static void main(String[] args) throws Exception {
Logging.initialize();
DistributedQueryRunner queryRunner = createQueryRunner(ImmutableMap.of("http-server.http.port", "8080"));
Thread.sleep(10);
Logger log = Logger.get(BlackHoleQueryRunner.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
use of com.facebook.presto.tests.DistributedQueryRunner in project presto by prestodb.
the class BigQueryQueryRunner method main.
public static void main(String[] args) throws Exception {
Logging.initialize();
DistributedQueryRunner queryRunner = createQueryRunner(ImmutableMap.of("http-server.http.port", "8080"));
Thread.sleep(10);
Logger log = Logger.get(BigQueryQueryRunner.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
use of com.facebook.presto.tests.DistributedQueryRunner in project presto by prestodb.
the class IcebergQueryRunner method main.
public static void main(String[] args) throws Exception {
Logging.initialize();
Map<String, String> properties = ImmutableMap.of("http-server.http.port", "8080");
DistributedQueryRunner queryRunner = null;
try {
queryRunner = createIcebergQueryRunner(properties);
} catch (Throwable t) {
log.error(t);
System.exit(1);
}
Thread.sleep(10);
Logger log = Logger.get(IcebergQueryRunner.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
use of com.facebook.presto.tests.DistributedQueryRunner in project presto by prestodb.
the class TestIcebergMetadataListing method createQueryRunner.
@Override
protected QueryRunner createQueryRunner() throws Exception {
Session session = testSessionBuilder().setIdentity(new Identity("hive", Optional.empty(), ImmutableMap.of("hive", new SelectedRole(ROLE, Optional.of("admin"))), ImmutableMap.of(), ImmutableMap.of())).build();
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session).build();
Path catalogDir = queryRunner.getCoordinator().getBaseDataDir().resolve("iceberg_data").resolve("catalog");
queryRunner.installPlugin(new IcebergPlugin());
Map<String, String> icebergProperties = ImmutableMap.<String, String>builder().put("hive.metastore", "file").put("hive.metastore.catalog.dir", catalogDir.toFile().toURI().toString()).build();
queryRunner.createCatalog(ICEBERG_CATALOG, "iceberg", icebergProperties);
queryRunner.installPlugin(new HivePlugin("hive"));
Map<String, String> hiveProperties = ImmutableMap.<String, String>builder().put("hive.metastore", "file").put("hive.metastore.catalog.dir", catalogDir.toFile().toURI().toString()).put("hive.security", "sql-standard").build();
queryRunner.createCatalog("hive", "hive", hiveProperties);
return queryRunner;
}
Aggregations