use of io.trino.plugin.blackhole.BlackHolePlugin in project trino by trinodb.
the class TestJdbcWarnings method setupServer.
@BeforeClass
public void setupServer() throws Exception {
server = TestingTrinoServer.builder().setProperties(ImmutableMap.<String, String>builder().put("testing-warning-collector.add-warnings", "true").put("testing-warning-collector.preloaded-warnings", String.valueOf(PRELOADED_WARNINGS)).buildOrThrow()).build();
server.installPlugin(new BlackHolePlugin());
server.createCatalog("blackhole", "blackhole");
server.waitForNodeRefresh(Duration.ofSeconds(10));
try (Connection connection = createConnection();
Statement statement = connection.createStatement()) {
statement.execute("CREATE SCHEMA blackhole.blackhole");
statement.executeUpdate("" + "CREATE TABLE slow_table (x int) " + "WITH (" + " split_count = 1, " + " pages_per_split = 5, " + " rows_per_page = 3, " + " page_processing_delay = '1s'" + ")");
}
}
use of io.trino.plugin.blackhole.BlackHolePlugin in project trino by trinodb.
the class TestTrinoDriver method setup.
@BeforeClass
public void setup() throws Exception {
Logging.initialize();
server = TestingTrinoServer.create();
server.installPlugin(new TpchPlugin());
server.createCatalog(TEST_CATALOG, "tpch");
server.installPlugin(new BlackHolePlugin());
server.createCatalog("blackhole", "blackhole");
server.waitForNodeRefresh(java.time.Duration.ofSeconds(10));
setupTestTables();
executorService = newCachedThreadPool(daemonThreadsNamed(getClass().getSimpleName() + "-%s"));
}
use of io.trino.plugin.blackhole.BlackHolePlugin in project trino by trinodb.
the class TestTrinoDatabaseMetaData method setupServer.
@BeforeClass
public void setupServer() throws Exception {
Logging.initialize();
server = TestingTrinoServer.create();
server.installPlugin(new TpchPlugin());
server.createCatalog(TEST_CATALOG, "tpch");
server.installPlugin(new BlackHolePlugin());
server.createCatalog("blackhole", "blackhole");
server.installPlugin(new HivePlugin());
server.createCatalog("hive", "hive", ImmutableMap.<String, String>builder().put("hive.metastore", "file").put("hive.metastore.catalog.dir", server.getBaseDataDir().resolve("hive").toAbsolutePath().toString()).put("hive.security", "sql-standard").buildOrThrow());
countingMockConnector = new CountingMockConnector();
server.installPlugin(countingMockConnector.getPlugin());
server.createCatalog(COUNTING_CATALOG, "mock", ImmutableMap.of());
server.waitForNodeRefresh(Duration.ofSeconds(10));
try (Connection connection = createConnection();
Statement statement = connection.createStatement()) {
statement.executeUpdate("CREATE SCHEMA blackhole.blackhole");
}
try (Connection connection = createConnection()) {
connection.setCatalog("hive");
try (Statement statement = connection.createStatement()) {
statement.execute("SET ROLE admin IN hive");
statement.execute("CREATE SCHEMA default");
statement.execute("CREATE TABLE default.test_table (a varchar)");
statement.execute("CREATE VIEW default.test_view AS SELECT * FROM hive.default.test_table");
}
}
}
use of io.trino.plugin.blackhole.BlackHolePlugin in project trino by trinodb.
the class TestJdbcConnection method setupServer.
@BeforeClass
public void setupServer() throws Exception {
Logging.initialize();
Module systemTables = binder -> newSetBinder(binder, SystemTable.class).addBinding().to(ExtraCredentialsSystemTable.class).in(Scopes.SINGLETON);
server = TestingTrinoServer.builder().setAdditionalModule(systemTables).build();
server.installPlugin(new HivePlugin());
server.createCatalog("hive", "hive", ImmutableMap.<String, String>builder().put("hive.metastore", "file").put("hive.metastore.catalog.dir", server.getBaseDataDir().resolve("hive").toAbsolutePath().toString()).put("hive.security", "sql-standard").buildOrThrow());
server.installPlugin(new BlackHolePlugin());
server.createCatalog("blackhole", "blackhole", ImmutableMap.of());
try (Connection connection = createConnection();
Statement statement = connection.createStatement()) {
statement.execute("SET ROLE admin IN hive");
statement.execute("CREATE SCHEMA default");
statement.execute("CREATE SCHEMA fruit");
statement.execute("CREATE TABLE blackhole.default.devzero(dummy bigint) " + "WITH (split_count = 100000, pages_per_split = 100000, rows_per_page = 10000)");
statement.execute("CREATE TABLE blackhole.default.delay(dummy bigint) " + "WITH (split_count = 1, pages_per_split = 1, rows_per_page = 1, page_processing_delay = '60s')");
}
}
use of io.trino.plugin.blackhole.BlackHolePlugin in project trino by trinodb.
the class TestJdbcPreparedStatement method setup.
@BeforeClass
public void setup() throws Exception {
Logging.initialize();
server = TestingTrinoServer.builder().setProperties(ImmutableMap.<String, String>builder().put("http-server.max-request-header-size", format("%sB", HEADER_SIZE_LIMIT)).put("http-server.max-response-header-size", format("%sB", HEADER_SIZE_LIMIT)).buildOrThrow()).build();
server.installPlugin(new BlackHolePlugin());
server.installPlugin(new MemoryPlugin());
server.createCatalog("blackhole", "blackhole");
server.createCatalog("memory", "memory");
server.waitForNodeRefresh(Duration.ofSeconds(10));
try (Connection connection = createConnection();
Statement statement = connection.createStatement()) {
statement.executeUpdate("CREATE SCHEMA blackhole.blackhole");
}
}
Aggregations