use of io.trino.sql.tree.QualifiedName in project trino by trinodb.
the class TestDropTableTask method testDropTableOnView.
@Test
public void testDropTableOnView() {
QualifiedName viewName = qualifiedName("existing_view");
metadata.createView(testSession, asQualifiedObjectName(viewName), someView(), false);
assertTrinoExceptionThrownBy(() -> getFutureValue(executeDropTable(viewName, false))).hasErrorCode(TABLE_NOT_FOUND).hasMessage("Table '%s' does not exist, but a view with that name exists. Did you mean DROP VIEW %s?", viewName, viewName);
}
use of io.trino.sql.tree.QualifiedName in project trino by trinodb.
the class TestDropTableTask method testDropNotExistingTable.
@Test
public void testDropNotExistingTable() {
QualifiedName tableName = qualifiedName("not_existing_table");
assertTrinoExceptionThrownBy(() -> getFutureValue(executeDropTable(tableName, false))).hasErrorCode(TABLE_NOT_FOUND).hasMessage("Table '%s' does not exist", tableName);
}
use of io.trino.sql.tree.QualifiedName in project trino by trinodb.
the class TestDropTableTask method testDropNotExistingTableIfExists.
@Test
public void testDropNotExistingTableIfExists() {
QualifiedName tableName = qualifiedName("not_existing_table");
getFutureValue(executeDropTable(tableName, true));
// no exception
}
use of io.trino.sql.tree.QualifiedName in project trino by trinodb.
the class TestDropViewTask method testDropViewOnMaterializedView.
@Test
public void testDropViewOnMaterializedView() {
QualifiedName viewName = qualifiedName("existing_materialized_view");
metadata.createMaterializedView(testSession, QualifiedObjectName.valueOf(viewName.toString()), someMaterializedView(), false, false);
assertTrinoExceptionThrownBy(() -> getFutureValue(executeDropView(viewName, false))).hasErrorCode(TABLE_NOT_FOUND).hasMessage("View '%s' does not exist, but a materialized view with that name exists. Did you mean DROP MATERIALIZED VIEW %s?", viewName, viewName);
}
use of io.trino.sql.tree.QualifiedName in project trino by trinodb.
the class TestDropViewTask method testDropNotExistingView.
@Test
public void testDropNotExistingView() {
QualifiedName viewName = qualifiedName("not_existing_view");
assertTrinoExceptionThrownBy(() -> getFutureValue(executeDropView(viewName, false))).hasErrorCode(TABLE_NOT_FOUND).hasMessage("View '%s' does not exist", viewName);
}
Aggregations