use of com.facebook.presto.spi.ConnectorViewDefinition in project presto by prestodb.
the class AbstractTestHiveClient method doCreateView.
private void doCreateView(SchemaTableName viewName, boolean replace) {
String viewData = "test data";
try (Transaction transaction = newTransaction()) {
transaction.getMetadata().createView(newSession(), viewName, viewData, replace);
transaction.commit();
}
try (Transaction transaction = newTransaction()) {
ConnectorMetadata metadata = transaction.getMetadata();
Map<SchemaTableName, ConnectorViewDefinition> views = metadata.getViews(newSession(), viewName.toSchemaTablePrefix());
assertEquals(views.size(), 1);
assertEquals(views.get(viewName).getViewData(), viewData);
assertTrue(metadata.listViews(newSession(), viewName.getSchemaName()).contains(viewName));
}
}
Aggregations