Search in sources :

Example 6 with QualifiedName

use of io.trino.sql.tree.QualifiedName in project trino by trinodb.

the class TestRenameTableTask method testRenameTableOnMaterializedViewIfExists.

@Test
public void testRenameTableOnMaterializedViewIfExists() {
    QualifiedName viewName = qualifiedName("existing_materialized_view");
    metadata.createMaterializedView(testSession, QualifiedObjectName.valueOf(viewName.toString()), someMaterializedView(), false, false);
    getFutureValue(executeRenameTable(viewName, qualifiedName("existing_materialized_view_new"), true));
// no exception
}
Also used : QualifiedName(io.trino.sql.tree.QualifiedName) Test(org.testng.annotations.Test)

Example 7 with QualifiedName

use of io.trino.sql.tree.QualifiedName in project trino by trinodb.

the class TestDropMaterializedViewTask method testDropNotExistingMaterializedViewIfExists.

@Test
public void testDropNotExistingMaterializedViewIfExists() {
    QualifiedName viewName = qualifiedName("not_existing_materialized_view");
    getFutureValue(executeDropMaterializedView(viewName, true));
// no exception
}
Also used : QualifiedName(io.trino.sql.tree.QualifiedName) Test(org.testng.annotations.Test)

Example 8 with QualifiedName

use of io.trino.sql.tree.QualifiedName in project trino by trinodb.

the class TestDropMaterializedViewTask method testDropMaterializedViewOnViewIfExists.

@Test
public void testDropMaterializedViewOnViewIfExists() {
    QualifiedName viewName = qualifiedName("existing_view");
    metadata.createView(testSession, asQualifiedObjectName(viewName), someView(), false);
    getFutureValue(executeDropMaterializedView(viewName, true));
// no exception
}
Also used : QualifiedName(io.trino.sql.tree.QualifiedName) Test(org.testng.annotations.Test)

Example 9 with QualifiedName

use of io.trino.sql.tree.QualifiedName in project trino by trinodb.

the class TestDropMaterializedViewTask method testDropMaterializedViewOnView.

@Test
public void testDropMaterializedViewOnView() {
    QualifiedName viewName = qualifiedName("existing_view");
    metadata.createView(testSession, asQualifiedObjectName(viewName), someView(), false);
    assertTrinoExceptionThrownBy(() -> getFutureValue(executeDropMaterializedView(viewName, false))).hasErrorCode(TABLE_NOT_FOUND).hasMessage("Materialized view '%s' does not exist, but a view with that name exists. Did you mean DROP VIEW %s?", viewName, viewName);
}
Also used : QualifiedName(io.trino.sql.tree.QualifiedName) Test(org.testng.annotations.Test)

Example 10 with QualifiedName

use of io.trino.sql.tree.QualifiedName in project trino by trinodb.

the class TestDropTableTask method testDropTableOnMaterializedViewIfExists.

@Test
public void testDropTableOnMaterializedViewIfExists() {
    QualifiedName viewName = qualifiedName("existing_materialized_view");
    metadata.createMaterializedView(testSession, asQualifiedObjectName(viewName), someMaterializedView(), false, false);
    getFutureValue(executeDropTable(viewName, true));
// no exception
}
Also used : QualifiedName(io.trino.sql.tree.QualifiedName) Test(org.testng.annotations.Test)

Aggregations

QualifiedName (io.trino.sql.tree.QualifiedName)42 Test (org.testng.annotations.Test)29 ComparisonExpression (io.trino.sql.tree.ComparisonExpression)7 FunctionCall (io.trino.sql.tree.FunctionCall)7 Identifier (io.trino.sql.tree.Identifier)7 ImmutableList (com.google.common.collect.ImmutableList)4 AllColumns (io.trino.sql.tree.AllColumns)4 Test (org.junit.jupiter.api.Test)4 ImmutableMap (com.google.common.collect.ImmutableMap)3 ImmutableSet (com.google.common.collect.ImmutableSet)3 MetadataManager.createTestMetadataManager (io.trino.metadata.MetadataManager.createTestMetadataManager)3 ResolvedFunction (io.trino.metadata.ResolvedFunction)3 ASC_NULLS_LAST (io.trino.spi.connector.SortOrder.ASC_NULLS_LAST)3 BIGINT (io.trino.spi.type.BigintType.BIGINT)3 QueryUtil.quotedIdentifier (io.trino.sql.QueryUtil.quotedIdentifier)3 TypeSignatureProvider.fromTypes (io.trino.sql.analyzer.TypeSignatureProvider.fromTypes)3 OrderingScheme (io.trino.sql.planner.OrderingScheme)3 PlanMatchPattern.functionCall (io.trino.sql.planner.assertions.PlanMatchPattern.functionCall)3 PlanMatchPattern.patternRecognition (io.trino.sql.planner.assertions.PlanMatchPattern.patternRecognition)3 PlanMatchPattern.specification (io.trino.sql.planner.assertions.PlanMatchPattern.specification)3